@@ -989,6 +989,31 @@ int test_notecard_begin_i2c_parameter_for_wirePort_has_begin_method_called()
989
989
return result;
990
990
}
991
991
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
+
992
1017
struct TestFunction ;
993
1018
typedef int (*test_fn)(void );
994
1019
int runTests (TestFunction *tests_, size_t cnt_);
@@ -1053,7 +1078,8 @@ int main(void)
1053
1078
{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" },
1054
1079
{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" },
1055
1080
{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" }
1057
1083
};
1058
1084
1059
1085
return runTests (tests, (sizeof (tests) / sizeof (TestFunction)));
0 commit comments