|
@@ -192,8 +192,8 @@ TEST_CASE( "shellmatta remove function" ) {
|
|
|
|
|
|
shellmatta_processData(handle, (char*)"? 564 321 56 465 46\r", 20);
|
|
shellmatta_processData(handle, (char*)"? 564 321 56 465 46\r", 20);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- CHECK( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ CHECK_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
|
|
|
|
write_callCnt = 0u;
|
|
write_callCnt = 0u;
|
|
memset(write_data, 0, sizeof(write_data));
|
|
memset(write_data, 0, sizeof(write_data));
|
|
@@ -206,8 +206,8 @@ TEST_CASE( "shellmatta remove function" ) {
|
|
"help ? help [command] - print help or usage information\r\n"
|
|
"help ? help [command] - print help or usage information\r\n"
|
|
"\r\nshellmatta->";
|
|
"\r\nshellmatta->";
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- REQUIRE( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ REQUIRE_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_CASE( "shellmatta reset no prompt" ) {
|
|
TEST_CASE( "shellmatta reset no prompt" ) {
|
|
@@ -240,8 +240,8 @@ TEST_CASE( "shellmatta reset no prompt" ) {
|
|
shellmatta_resetShell(handle, false);
|
|
shellmatta_resetShell(handle, false);
|
|
shellmatta_processData(handle, (char*)"?\r", 2);
|
|
shellmatta_processData(handle, (char*)"?\r", 2);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- REQUIRE( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ REQUIRE_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_CASE( "shellmatta reset with prompt" ) {
|
|
TEST_CASE( "shellmatta reset with prompt" ) {
|
|
@@ -275,8 +275,8 @@ TEST_CASE( "shellmatta reset with prompt" ) {
|
|
shellmatta_resetShell(handle, true);
|
|
shellmatta_resetShell(handle, true);
|
|
shellmatta_processData(handle, (char*)"?\r", 2);
|
|
shellmatta_processData(handle, (char*)"?\r", 2);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- REQUIRE( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ REQUIRE_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_CASE( "shellmatta reset no prompt history buffer" ) {
|
|
TEST_CASE( "shellmatta reset no prompt history buffer" ) {
|
|
@@ -315,8 +315,8 @@ TEST_CASE( "shellmatta reset no prompt history buffer" ) {
|
|
shellmatta_processData(handle, (char*)"\033[A", 3u);
|
|
shellmatta_processData(handle, (char*)"\033[A", 3u);
|
|
shellmatta_processData(handle, (char*)"?\r", 2);
|
|
shellmatta_processData(handle, (char*)"?\r", 2);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- REQUIRE( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ REQUIRE_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_CASE( "shellmatta reset no prompt heredoc" ) {
|
|
TEST_CASE( "shellmatta reset no prompt heredoc" ) {
|
|
@@ -355,8 +355,8 @@ TEST_CASE( "shellmatta reset no prompt heredoc" ) {
|
|
/* now the new command should be processed */
|
|
/* now the new command should be processed */
|
|
shellmatta_processData(handle, (char*)"?\r", 2);
|
|
shellmatta_processData(handle, (char*)"?\r", 2);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- REQUIRE( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ REQUIRE_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_CASE( "shellmatta configure disable echo" ) {
|
|
TEST_CASE( "shellmatta configure disable echo" ) {
|
|
@@ -393,8 +393,8 @@ TEST_CASE( "shellmatta configure disable echo" ) {
|
|
/* check with echo enabled */
|
|
/* check with echo enabled */
|
|
shellmatta_processData(handle, (char*)"help this is some dummy Text\r\n", 30u);
|
|
shellmatta_processData(handle, (char*)"help this is some dummy Text\r\n", 30u);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- CHECK( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ CHECK_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
|
|
|
|
write_callCnt = 0u;
|
|
write_callCnt = 0u;
|
|
memset(write_data, 0, sizeof(write_data));
|
|
memset(write_data, 0, sizeof(write_data));
|
|
@@ -407,8 +407,8 @@ TEST_CASE( "shellmatta configure disable echo" ) {
|
|
/* check with echo disabled */
|
|
/* check with echo disabled */
|
|
shellmatta_processData(handle, (char*)"help this is some dummy Text\r\n", 30u);
|
|
shellmatta_processData(handle, (char*)"help this is some dummy Text\r\n", 30u);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData2));
|
|
|
|
- REQUIRE( strcmp(dummyData2, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData2));
|
|
|
|
+ REQUIRE_THAT(write_data, Catch::Matchers::Equals(dummyData2));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_CASE( "shellmatta configure mode" ) {
|
|
TEST_CASE( "shellmatta configure mode" ) {
|
|
@@ -441,8 +441,8 @@ TEST_CASE( "shellmatta configure mode" ) {
|
|
/* check with insert mode */
|
|
/* check with insert mode */
|
|
shellmatta_processData(handle, (char*)"meow this is some dummy Text\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D123456\r\n", 57u);
|
|
shellmatta_processData(handle, (char*)"meow this is some dummy Text\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D123456\r\n", 57u);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- CHECK( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ CHECK_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
|
|
|
|
write_callCnt = 0u;
|
|
write_callCnt = 0u;
|
|
memset(write_data, 0, sizeof(write_data));
|
|
memset(write_data, 0, sizeof(write_data));
|
|
@@ -455,8 +455,8 @@ TEST_CASE( "shellmatta configure mode" ) {
|
|
/* check with echo disabled */
|
|
/* check with echo disabled */
|
|
shellmatta_processData(handle, (char*)"meow this is some dummy Text\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D123456\r\n", 57u);
|
|
shellmatta_processData(handle, (char*)"meow this is some dummy Text\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D\x1b[D123456\r\n", 57u);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData2));
|
|
|
|
- REQUIRE( strcmp(dummyData2, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData2));
|
|
|
|
+ REQUIRE_THAT(write_data, Catch::Matchers::Equals(dummyData2));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_CASE( "shellmatta configure delimiter" ) {
|
|
TEST_CASE( "shellmatta configure delimiter" ) {
|
|
@@ -501,6 +501,6 @@ TEST_CASE( "shellmatta configure delimiter" ) {
|
|
/* check with echo disabled */
|
|
/* check with echo disabled */
|
|
shellmatta_processData(handle, (char*)"doSomething argument\n", 21u);
|
|
shellmatta_processData(handle, (char*)"doSomething argument\n", 21u);
|
|
|
|
|
|
- CHECK( write_length == strlen(dummyData));
|
|
|
|
- REQUIRE( strcmp(dummyData, write_data) == 0);
|
|
|
|
|
|
+ CHECK(write_length == strlen(dummyData));
|
|
|
|
+ REQUIRE_THAT(write_data, Catch::Matchers::Equals(dummyData));
|
|
}
|
|
}
|