tcp_cmd
Add tcp_cmd_remove_leading_space + tests
This commit is contained in:
@@ -54,6 +54,22 @@ TEST(TCP_CMD, tcp_cmd_remove_newline) {
|
||||
free(cmd);
|
||||
}
|
||||
|
||||
TEST(TCP_CMD, tcp_cmd_remove_leading_space) {
|
||||
char* cmd = (char*)calloc(50, 1);
|
||||
strcpy(cmd, "help");
|
||||
EXPECT_STREQ(tcp_cmd_remove_leading_space(cmd, strlen(cmd)), "help");
|
||||
strcpy(cmd, " help");
|
||||
EXPECT_STREQ(tcp_cmd_remove_leading_space(cmd, strlen(cmd)), "help");
|
||||
strcpy(cmd, " help");
|
||||
EXPECT_STREQ(tcp_cmd_remove_leading_space(cmd, strlen(cmd)), "help");
|
||||
strcpy(cmd, " help");
|
||||
EXPECT_STREQ(tcp_cmd_remove_leading_space(cmd, strlen(cmd)), "help");
|
||||
strcpy(cmd, " help");
|
||||
EXPECT_STREQ(tcp_cmd_remove_leading_space(cmd, strlen(cmd)), "help");
|
||||
strcpy(cmd, "\n\t\r\n help");
|
||||
EXPECT_STREQ(tcp_cmd_remove_leading_space(cmd, strlen(cmd)), "help");
|
||||
}
|
||||
|
||||
TEST(TCP_CMD, tcp_data_cb) {
|
||||
char* cmd = (char*)calloc(50, 1);
|
||||
std::string output;
|
||||
|
||||
Reference in New Issue
Block a user