8 #ifdef __bool_true_false_are_defined
10 bool ternary(unsigned char status)
12 return (status == 0) ? 0 : 1;
15 bool ternary_inv(unsigned char status)
17 return (status == 0) ? 1 : 0;
21 bool ternary1(unsigned char status)
23 return status ? 1 : 0;
26 bool ternary1_inv(unsigned char status)
28 return status ? 0 : 1;
32 bool ternary2(unsigned char status)
34 return !status ? 0 : 1;
37 bool ternary2_inv(unsigned char status)
39 return !status ? 1 : 0;
42 #endif //__bool_true_false_are_defined
48 #ifdef __bool_true_false_are_defined
49 ASSERT(!ternary(0x00));
50 ASSERT( ternary(0x10));
52 ASSERT( ternary_inv(0x00));
53 ASSERT(!ternary_inv(0x10));
55 ASSERT(!ternary1(0x00));
56 ASSERT( ternary1(0x10));
58 ASSERT( ternary1_inv(0x00));
59 ASSERT(!ternary1_inv(0x10));
61 ASSERT(!ternary2(0x00));
62 ASSERT( ternary2(0x10));
64 ASSERT( ternary2_inv(0x00));
65 ASSERT(!ternary2_inv(0x10));
66 ASSERT(!ternary2_inv(1==1));
67 #endif //__bool_true_false_are_defined