4 #include "ntp_calendar.h"
5 #include "ntp_stdlib.h"
11 #include "test-libntp.h"
15 test_EvaluateCommandLength(void){
16 size_t length, commandLength;
17 const char *command1 = "Random Command";
18 const char *command2 = "Random Command\t\t\n\t";
19 const char *command3 = "Random\nCommand\t\t\n\t";
20 const char *command4 = "Random Command\t\t\n\t1 2 3";
22 length = strlen(command1);
23 commandLength = remoteconfig_cmdlength(command1, command1+length);
24 TEST_ASSERT_EQUAL(14, commandLength );
26 length = strlen(command2);
27 commandLength = remoteconfig_cmdlength(command2, command2+length);
28 TEST_ASSERT_EQUAL(14, commandLength );
30 length = strlen(command3);
31 commandLength = remoteconfig_cmdlength(command3, command3+length);
32 TEST_ASSERT_EQUAL(6, commandLength );
34 length = strlen(command4);
35 commandLength = remoteconfig_cmdlength(command4, command4+length);
36 TEST_ASSERT_EQUAL(16, commandLength );