-
Notifications
You must be signed in to change notification settings - Fork 1
/
TempControlPeriodic_p_tcproc_tempControl_UnitTestConfiguration_Util.scala
140 lines (122 loc) · 5.58 KB
/
TempControlPeriodic_p_tcproc_tempControl_UnitTestConfiguration_Util.scala
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// #Sireum
package tc.TempControlSoftwareSystem
// Do not edit this file as it will be overwritten if HAMR codegen is rerun
import org.sireum._
import tc.GumboXUtil.GumboXResult
import tc.util.{Container, Profile, UnitTestConfigurationBatch}
import tc.RandomLib
import org.sireum.Random.Impl.Xoshiro256
object TempControlPeriodic_p_tcproc_tempControl_UnitTestConfiguration_Util {
def freshRandomLib: RandomLib = {
return RandomLib(Random.Gen64Impl(Xoshiro256.create))
}
val tq: String = "\"\"\""
type DefaultInitializeProfile = TempControlPeriodic_p_tcproc_tempControl_Profile
def defaultInitializeConfig: TempControlPeriodic_p_tcproc_tempControl_Initialize_UnitTestConfiguration = {
return (TempControlPeriodic_p_tcproc_tempControl_Initialize_UnitTestConfiguration (
verbose = F,
name = "Default_Initialize_Config",
description = "Default Initialize Configuration",
numTests = 100,
numTestVectorGenRetries = 100,
failOnUnsatPreconditions = F,
profile = TempControlPeriodic_p_tcproc_tempControl_Profile (
name = "Initialize_Default_Profile",
),
genReplay = (c: Container, testName: String, r: GumboXResult.Type) => None())
)
}
type DefaultComputeProfile = TempControlPeriodic_p_tcproc_tempControl_Profile_P
def defaultComputeConfig: TempControlPeriodic_p_tcproc_tempControl_Compute_UnitTestConfiguration = {
return (TempControlPeriodic_p_tcproc_tempControl_Compute_UnitTestConfiguration (
verbose = F,
name = "Default_Compute_Config",
description = "Default Compute Configuration",
numTests = 100,
numTestVectorGenRetries = 100,
failOnUnsatPreconditions = F,
profile = TempControlPeriodic_p_tcproc_tempControl_Profile_P (
name = "Compute_Default_Profile",
api_currentTemp = freshRandomLib,
api_fanAck = freshRandomLib,
api_setPoint = freshRandomLib
),
genReplay = (c: Container, testName: String, r: GumboXResult.Type) => Some(
st"""Replay Unit Test:
| test("Replay: $testName") {
| val results = tc.GumboXUtil.GumboXResult.$r
| val json = st${tq}${tc.JSON.fromutilContainer(c, T)}${tq}.render
| val testVector = tc.JSON.toTempControlSoftwareSystemTempControlPeriodic_p_tcproc_tempControl_PreState_Container_P(json).left
| assert (testComputeCBV(testVector) == results)
| }""".render))
)
}
type DefaultComputewLProfile = TempControlPeriodic_p_tcproc_tempControl_Profile_PS
def defaultComputewLConfig: TempControlPeriodic_p_tcproc_tempControl_ComputewL_UnitTestConfiguration = {
return (TempControlPeriodic_p_tcproc_tempControl_ComputewL_UnitTestConfiguration (
verbose = F,
name = "Default_ComputewL_Config",
description = "Default ComputewL Configuration",
numTests = 100,
numTestVectorGenRetries = 100,
failOnUnsatPreconditions = F,
profile = TempControlPeriodic_p_tcproc_tempControl_Profile_PS (
name = "ComputewL_Default_Profile",
In_latestFanCmd = freshRandomLib,
api_currentTemp = freshRandomLib,
api_fanAck = freshRandomLib,
api_setPoint = freshRandomLib
),
genReplay = (c: Container, testName: String, r: GumboXResult.Type) => Some(
st"""Replay Unit Test:
| test("Replay: $testName") {
| val results = tc.GumboXUtil.GumboXResult.$r
| val json = st${tq}${tc.JSON.fromutilContainer(c, T)}${tq}.render
| val testVector = tc.JSON.toTempControlSoftwareSystemTempControlPeriodic_p_tcproc_tempControl_PreState_Container_PS(json).left
| assert (testComputeCBwLV(testVector) == results)
| }""".render))
)
}
}
@record class TempControlPeriodic_p_tcproc_tempControl_Initialize_UnitTestConfiguration (
var verbose: B,
var name: String,
var description: String,
var numTests: Z,
var numTestVectorGenRetries: Z,
var failOnUnsatPreconditions: B,
var profile: TempControlPeriodic_p_tcproc_tempControl_Profile_Trait,
var genReplay: (Container, String, GumboXResult.Type) => Option[String])
extends UnitTestConfigurationBatch with TempControlPeriodic_p_tcproc_tempControl_GumboX_TestHarness {
override def test(c: Container): GumboXResult.Type = {
return testInitialiseCB()
}
}
@record class TempControlPeriodic_p_tcproc_tempControl_Compute_UnitTestConfiguration (
var verbose: B,
var name: String,
var description: String,
var numTests: Z,
var numTestVectorGenRetries: Z,
var failOnUnsatPreconditions: B,
var profile: TempControlPeriodic_p_tcproc_tempControl_Profile_P_Trait,
var genReplay: (Container, String, GumboXResult.Type) => Option[String])
extends UnitTestConfigurationBatch with TempControlPeriodic_p_tcproc_tempControl_GumboX_TestHarness {
override def test(c: Container): GumboXResult.Type = {
return testComputeCBV(c.asInstanceOf[TempControlPeriodic_p_tcproc_tempControl_PreState_Container])
}
}
@record class TempControlPeriodic_p_tcproc_tempControl_ComputewL_UnitTestConfiguration (
var verbose: B,
var name: String,
var description: String,
var numTests: Z,
var numTestVectorGenRetries: Z,
var failOnUnsatPreconditions: B,
var profile: TempControlPeriodic_p_tcproc_tempControl_Profile_PS_Trait,
var genReplay: (Container, String, GumboXResult.Type) => Option[String])
extends UnitTestConfigurationBatch with TempControlPeriodic_p_tcproc_tempControl_GumboX_TestHarness {
override def test(c: Container): GumboXResult.Type = {
return testComputeCBwLV(c.asInstanceOf[TempControlPeriodic_p_tcproc_tempControl_PreState_Container_PS])
}
}