@@ -16,7 +16,7 @@ int test_make_note_txn_instantiates_notetxn_object()
16
16
uint8_t txn_pins[2 ] = {19 , 79 };
17
17
18
18
// Action
19
- notetxn = make_note_txn (reinterpret_cast <NoteTxn:: param_t >( txn_pins) );
19
+ notetxn = make_note_txn (txn_pins);
20
20
21
21
// Assert
22
22
if (nullptr != notetxn)
@@ -32,7 +32,8 @@ int test_make_note_txn_instantiates_notetxn_object()
32
32
}
33
33
34
34
// Clean-up
35
- make_note_txn (nullptr );
35
+ uint8_t invalid_pins[2 ] = {0 };
36
+ make_note_txn (invalid_pins);
36
37
37
38
return result;
38
39
}
@@ -43,11 +44,11 @@ int test_make_note_txn_enforces_singleton_by_returning_same_notetxn_object_for_a
43
44
44
45
// Arrange
45
46
uint8_t txn_pins_1[2 ] = {19 , 79 };
46
- NoteTxn * const notetxn_1 = make_note_txn (reinterpret_cast <NoteTxn:: param_t >( txn_pins_1) );
47
+ NoteTxn * const notetxn_1 = make_note_txn (txn_pins_1);
47
48
48
49
// Action
49
50
uint8_t txn_pins_2[2 ] = {9 , 17 };
50
- NoteTxn * const notetxn_2 = make_note_txn (reinterpret_cast <NoteTxn:: param_t >( txn_pins_2) );
51
+ NoteTxn * const notetxn_2 = make_note_txn (txn_pins_2);
51
52
52
53
// Assert
53
54
if (notetxn_1 == notetxn_2)
@@ -63,23 +64,25 @@ int test_make_note_txn_enforces_singleton_by_returning_same_notetxn_object_for_a
63
64
}
64
65
65
66
// Clean-up
66
- make_note_txn (nullptr );
67
+ uint8_t invalid_pins[2 ] = {0 };
68
+ make_note_txn (invalid_pins);
67
69
68
70
return result;
69
71
}
70
72
71
- // int test_make_note_txn_returns_nullptr_when_nullptr_is_passed_as_parameter ()
72
- int test_make_note_txn_deletes_singleton_when_nullptr_is_passed_as_parameter ()
73
+ // int test_make_note_txn_returns_nullptr_when_same_pins_are_passed_as_parameter ()
74
+ int test_make_note_txn_deletes_singleton_when_same_pins_are_passed_as_parameter ()
73
75
{
74
76
int result;
75
77
76
78
// Arrange
77
79
uint8_t txn_pins[2 ] = {19 , 79 };
78
- NoteTxn * notetxn = make_note_txn (reinterpret_cast <NoteTxn:: param_t >( txn_pins) );
80
+ NoteTxn * notetxn = make_note_txn (txn_pins);
79
81
assert (notetxn);
80
82
81
83
// Action
82
- notetxn = make_note_txn (nullptr );
84
+ uint8_t invalid_pins[2 ] = {0 };
85
+ notetxn = make_note_txn (invalid_pins);
83
86
84
87
// Assert
85
88
if (nullptr == notetxn)
@@ -605,7 +608,7 @@ int main(void)
605
608
TestFunction tests[] = {
606
609
{test_make_note_txn_instantiates_notetxn_object, " test_make_note_txn_instantiates_notetxn_object" },
607
610
{test_make_note_txn_enforces_singleton_by_returning_same_notetxn_object_for_all_calls, " test_make_note_txn_enforces_singleton_by_returning_same_notetxn_object_for_all_calls" },
608
- {test_make_note_txn_deletes_singleton_when_nullptr_is_passed_as_parameter , " test_make_note_txn_deletes_singleton_when_nullptr_is_passed_as_parameter " },
611
+ {test_make_note_txn_deletes_singleton_when_same_pins_are_passed_as_parameter , " test_make_note_txn_deletes_singleton_when_same_pins_are_passed_as_parameter " },
609
612
{test_notetxn_arduino_constructor_floats_ctx_pin, " test_notetxn_arduino_constructor_floats_ctx_pin" },
610
613
{test_notetxn_arduino_constructor_floats_rtx_pin, " test_notetxn_arduino_constructor_floats_rtx_pin" },
611
614
{test_notetxn_arduino_start_initially_configures_ctx_pin_as_input_pullup, " test_notetxn_arduino_start_initially_configures_ctx_pin_as_input_pullup" },
0 commit comments