blob: ce394d465dab4a5d3e5a5a3ee8e72749243f0385 [file] [log] [blame]
Imre Kisa21712e2019-10-08 12:56:59 +02001'-------------------------------------------------------------------------------
2' Copyright (c) 2019-2021, Arm Limited and Contributors. All rights reserved.
3'
4' SPDX-License-Identifier: BSD-3-Clause
5'
6'-------------------------------------------------------------------------------
7
8@startuml
9participant "Test case" as TC
10participant "Code under test" as CUT
11
12group Setting expectations
13 activate TC
14 TC -> Mock: expect_write("hello1hello2", 6)
15 activate Mock
16 deactivate Mock
17 TC -> Mock: expect_write("hello2", 6)
18 activate Mock
19 deactivate Mock
20end
21
22TC -> CUT: print_to_eeprom("hello%dhello%d", 1, 2)
23activate CUT
24
25 group Using mocked interface
26 CUT -> Mock: eeprom_write("hello1hello2")
27 activate Mock
28 Mock --> CUT: 6
29 deactivate Mock
30
31 CUT -> Mock: eeprom_write("hello2")
32 activate Mock
33 Mock --> CUT: 6
34 deactivate Mock
35 end
36
37CUT --> TC: 6 + 6 = 12
38deactivate CUT
39
40TC -> Mock: mock().checkExpectation()
41activate Mock
42deactivate Mock
43
44TC -> Mock: mock().clear()
45activate Mock
46deactivate Mock
47
48@enduml