@@ -989,6 +989,31 @@ int test_notecard_begin_i2c_parameter_for_wirePort_has_begin_method_called()
989989 return result;
990990}
991991
992+ int test_notecard_begin_serial_default_parameter_for_baud_rate_is_passed_to_note_c ()
993+ {
994+ int result;
995+ Notecard notecard;
996+ const unsigned int baud = 9600 ;
997+
998+ // Setup
999+ hardwareSerialBegin_Parameters.baud = (baud - 1 );
1000+
1001+ // Action
1002+ notecard.begin (Serial);
1003+
1004+ // Evaluate Result
1005+ if (baud == hardwareSerialBegin_Parameters.baud )
1006+ {
1007+ result = 0 ;
1008+ }
1009+ else
1010+ {
1011+ result = 39 ;
1012+ }
1013+
1014+ return result;
1015+ }
1016+
9921017struct TestFunction ;
9931018typedef int (*test_fn)(void );
9941019int runTests (TestFunction *tests_, size_t cnt_);
@@ -1053,7 +1078,8 @@ int main(void)
10531078 {test_notecard_responseError_does_not_modify_j_object_parameter_value_before_passing_to_note_c, " test_notecard_responseError_does_not_modify_j_object_parameter_value_before_passing_to_note_c" },
10541079 {test_notecard_responseError_does_not_modify_note_c_result_value_before_returning_to_caller, " test_notecard_responseError_does_not_modify_note_c_result_value_before_returning_to_caller" },
10551080 {test_notecard_begin_i2c_default_parameter_for_wirePort_has_begin_method_called, " test_notecard_begin_i2c_default_parameter_for_wirePort_has_begin_method_called" },
1056- {test_notecard_begin_i2c_parameter_for_wirePort_has_begin_method_called, " test_notecard_begin_i2c_parameter_for_wirePort_has_begin_method_called" }
1081+ {test_notecard_begin_i2c_parameter_for_wirePort_has_begin_method_called, " test_notecard_begin_i2c_parameter_for_wirePort_has_begin_method_called" },
1082+ {test_notecard_begin_serial_default_parameter_for_baud_rate_is_passed_to_note_c, " test_notecard_begin_serial_default_parameter_for_baud_rate_is_passed_to_note_c" }
10571083 };
10581084
10591085 return runTests (tests, (sizeof (tests) / sizeof (TestFunction)));
0 commit comments