/
porcupine.go
39 lines (32 loc) · 1.33 KB
/
porcupine.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package porcupine
import "time"
func CheckOperations(model Model, history []Operation) bool {
res, _ := checkOperations(model, history, false, 0)
return res == Ok
}
// timeout = 0 means no timeout
// if this operation times out, then a false positive is possible
func CheckOperationsTimeout(model Model, history []Operation, timeout time.Duration) CheckResult {
res, _ := checkOperations(model, history, false, timeout)
return res
}
// timeout = 0 means no timeout
// if this operation times out, then a false positive is possible
func CheckOperationsVerbose(model Model, history []Operation, timeout time.Duration) (CheckResult, linearizationInfo) {
return checkOperations(model, history, true, timeout)
}
func CheckEvents(model Model, history []Event) bool {
res, _ := checkEvents(model, history, false, 0)
return res == Ok
}
// timeout = 0 means no timeout
// if this operation times out, then a false positive is possible
func CheckEventsTimeout(model Model, history []Event, timeout time.Duration) CheckResult {
res, _ := checkEvents(model, history, false, timeout)
return res
}
// timeout = 0 means no timeout
// if this operation times out, then a false positive is possible
func CheckEventsVerbose(model Model, history []Event, timeout time.Duration) (CheckResult, linearizationInfo) {
return checkEvents(model, history, true, timeout)
}