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