Skip to content

Commit 3c4a0ca

Browse files
committed
Add unit test spec outcome
1 parent c1685a0 commit 3c4a0ca

File tree

5 files changed

+15
-25
lines changed

5 files changed

+15
-25
lines changed

.vscode/tasks.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
{
55
"label": "Install dependencies",
66
"type": "shell",
7-
"command": ".\\install.ps1",
7+
"command": "npm install",
88
"problemMatcher": []
99
},
1010
{
1111
"label": "Run local web server",
1212
"type": "shell",
13-
"command": ".\\run.ps1",
13+
"command": "npm start",
1414
"problemMatcher": []
1515
},
1616
{

chapters/05_aspice.md

+12-5
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ Design Considerations
148148

149149
--
150150

151-
### Test Code
151+
### Unit Test Specification
152152

153+
![](images/lc_uts.png) <!-- .element: class="fragment" data-fragment-index="2" style="float: right; width: 40%" -->
153154

154-
```C
155+
```C[50: ]
155156
/*!
156157
* @rst
157158
*
@@ -166,15 +167,21 @@ TEST(light_controller, test_light_stays_off)
166167
CREATE_MOCK(mymock);
167168
168169
// Initial state: Power is OFF, so the light should be OFF.
169-
EXPECT_CALL(mymock, RteGetPowerState()).WillRepeatedly(Return(POWER_STATE_OFF));
170-
EXPECT_CALL(mymock, RteSetLightValue(_)).Times(0); // Expect that the light value doesn't change.
170+
EXPECT_CALL(
171+
mymock,
172+
RteGetPowerState()
173+
).WillRepeatedly(Return(POWER_STATE_OFF));
174+
EXPECT_CALL(
175+
mymock,
176+
RteSetLightValue(_)
177+
).Times(0); // Expect that the light value doesn't change.
171178
172179
for (int i = 0; i < 10; i++) {
173180
lightController();
174181
}
175182
}
176183
```
177-
<!-- .element: style="font-size:10pt" -->
184+
<!-- .element: class="fragment" data-fragment-index="1" style="float: left; font-size:10pt; width: 55%" -->
178185

179186
--
180187

images/lc_uts.png

90 KB
Loading

install.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Push-Location $PSScriptRoot
1010

1111
try {
1212
scoop install nodejs
13-
npm install reveal.js
13+
npm install
1414
}
1515
finally {
1616
Pop-Location

run.ps1

-17
This file was deleted.

0 commit comments

Comments
 (0)