Spexygen Reference Manual 3.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
test2.c
Go to the documentation of this file.
1
#include "
header.h
"
2
#include "unity.h"
3
4
void
setUp
(
void
) {
5
}
6
7
void
tearDown
(
void
) {
8
}
9
10
/*!
11
@code_uid{TUN_PRJ_Foo_ctor_01, constructor test}
12
@code_litem{Details}
13
This test checks that Foo_ctor() produces valid instance.
14
@code_bw_trace{brief}
15
- [@tr{SRS_EXA_REQ_12}] <i>Class Foo shall provide a constructor.</i>
16
- [@tr{Foo_ctor()}] <i>Constructor of class Foo brief description</i>
17
@endcode_uid
18
*/
19
void
TUN_PRJ_Foo_ctor_01
(
void
) {
20
Foo_ctor
(&
Foo_inst
, 0x12345678);
21
TEST_ASSERT_EQUAL_INT32(0x12345678,
Foo_inst
.
x
);
22
TEST_ASSERT_EQUAL_INT32(~0x12345678,
Foo_inst
.
x_dis
);
23
}
24
25
/*!
26
@code_uid{TUN_PRJ_Foo_verify_00, verify positive test}
27
@code_litem{Details}
28
This test checks that Foo_verify_() distinguishes valid instance.
29
@code_bw_trace{brief}
30
- [@tr{SRS_EXA_REQ_13}] <i>@badge{safety} Class Foo shall provide a verify operation.</i>
31
- [@tr{Foo_verify_()}] <i>Verify operation to check the class invariant</i>
32
@endcode_uid
33
*/
34
void
TUN_PRJ_Foo_verify_00
(
void
) {
35
Foo_ctor
(&
Foo_inst
, 0x12345678);
36
TEST_ASSERT_TRUE(
Foo_verify_
(&
Foo_inst
));
37
}
38
39
/*!
40
@code_uid{TUN_PRJ_Foo_verify_01, verify negative test}
41
@code_litem{Details}
42
This test checks that Foo_verify_() distinguishes invalid instance.
43
@code_bw_trace{brief}
44
- [@tr{SRS_EXA_REQ_13}] <i>@badge{safety} Class Foo shall provide a verify operation.</i>
45
- [@tr{Foo_verify_()}] <i>Verify operation to check the class invariant</i>
46
@endcode_uid
47
*/
48
void
TUN_PRJ_Foo_verify_01
(
void
) {
49
Foo_ctor
(&
Foo_inst
, 0x12345678);
50
Foo_inst
.
x
-= 1;
// change x
51
TEST_ASSERT_FALSE(
Foo_verify_
(&
Foo_inst
));
52
}
header.h
a header file in the project
Foo_ctor
void Foo_ctor(Foo *const me, uint32_t const x)
Definition
source.c:14
Foo_verify_
bool Foo_verify_(Foo const *const me)
Definition
source.c:23
Foo_inst
Foo Foo_inst
Definition
source.c:12
Foo::x_dis
uint32_t x_dis
Duplicate Inverse Storage for attribute Foo::x.
Definition
header.h:20
Foo::x
uint32_t x
Attribute x of class Foo brief description.
Definition
header.h:19
setUp
void setUp(void)
Definition
test1.c:4
tearDown
void tearDown(void)
Definition
test1.c:7
TUN_PRJ_Foo_verify_01
void TUN_PRJ_Foo_verify_01(void)
verify negative test
Definition
test2.c:48
TUN_PRJ_Foo_verify_00
void TUN_PRJ_Foo_verify_00(void)
verify positive test
Definition
test2.c:34
TUN_PRJ_Foo_ctor_01
void TUN_PRJ_Foo_ctor_01(void)
constructor test
Definition
test2.c:19
spex
test2.c
© 2005-
Quantum Leaps
|
Using Online Help
|
Spexygen 3.0.0
| created with
Spexygen
© 2005-
Quantum Leaps
|
Using Online Help
|
Spexygen 3.0.0
| created with
Spexygen