@@ -16,7 +16,7 @@ int test_make_note_txn_instantiates_notetxn_object()
1616 uint8_t txn_pins[2 ] = {19 , 79 };
1717
1818 // Action
19- notetxn = make_note_txn (reinterpret_cast <NoteTxn:: param_t >( txn_pins) );
19+ notetxn = make_note_txn (txn_pins);
2020
2121 // Assert
2222 if (nullptr != notetxn)
@@ -32,7 +32,8 @@ int test_make_note_txn_instantiates_notetxn_object()
3232 }
3333
3434 // Clean-up
35- make_note_txn (nullptr );
35+ uint8_t invalid_pins[2 ] = {0 };
36+ make_note_txn (invalid_pins);
3637
3738 return result;
3839}
@@ -43,11 +44,11 @@ int test_make_note_txn_enforces_singleton_by_returning_same_notetxn_object_for_a
4344
4445 // Arrange
4546 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);
4748
4849 // Action
4950 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);
5152
5253 // Assert
5354 if (notetxn_1 == notetxn_2)
@@ -63,23 +64,25 @@ int test_make_note_txn_enforces_singleton_by_returning_same_notetxn_object_for_a
6364 }
6465
6566 // Clean-up
66- make_note_txn (nullptr );
67+ uint8_t invalid_pins[2 ] = {0 };
68+ make_note_txn (invalid_pins);
6769
6870 return result;
6971}
7072
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 ()
7375{
7476 int result;
7577
7678 // Arrange
7779 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);
7981 assert (notetxn);
8082
8183 // Action
82- notetxn = make_note_txn (nullptr );
84+ uint8_t invalid_pins[2 ] = {0 };
85+ notetxn = make_note_txn (invalid_pins);
8386
8487 // Assert
8588 if (nullptr == notetxn)
@@ -605,7 +608,7 @@ int main(void)
605608 TestFunction tests[] = {
606609 {test_make_note_txn_instantiates_notetxn_object, " test_make_note_txn_instantiates_notetxn_object" },
607610 {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 " },
609612 {test_notetxn_arduino_constructor_floats_ctx_pin, " test_notetxn_arduino_constructor_floats_ctx_pin" },
610613 {test_notetxn_arduino_constructor_floats_rtx_pin, " test_notetxn_arduino_constructor_floats_rtx_pin" },
611614 {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