13 #ifdef __bool_true_false_are_defined
15 bool ternary(unsigned char status
)
17 return (status
== 0) ? 0 : 1;
20 bool ternary_inv(unsigned char status
)
22 return (status
== 0) ? 1 : 0;
26 bool ternary1(unsigned char status
)
28 return status
? 1 : 0;
31 bool ternary1_inv(unsigned char status
)
33 return status
? 0 : 1;
37 bool ternary2(unsigned char status
)
39 return !status
? 0 : 1;
42 bool ternary2_inv(unsigned char status
)
44 return !status
? 1 : 0;
47 #endif //__bool_true_false_are_defined
54 #ifdef __bool_true_false_are_defined
55 ASSERT(!ternary(0x00));
56 ASSERT( ternary(0x10));
58 ASSERT( ternary_inv(0x00));
59 ASSERT(!ternary_inv(0x10));
61 ASSERT(!ternary1(0x00));
62 ASSERT( ternary1(0x10));
64 ASSERT( ternary1_inv(0x00));
65 ASSERT(!ternary1_inv(0x10));
67 ASSERT(!ternary2(0x00));
68 ASSERT( ternary2(0x10));
70 ASSERT( ternary2_inv(0x00));
71 ASSERT(!ternary2_inv(0x10));
72 ASSERT(!ternary2_inv(1==1));
73 #endif //__bool_true_false_are_defined