tcp_cmd
fix all tests
This commit is contained in:
@@ -65,24 +65,27 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "help : shows a list of commands\r\n"
|
EXPECT_EQ(output, "help : shows a list of commands\n"
|
||||||
"text \"<text>\" : puts text on the lcd\r\n"
|
"clear text/images : clears the text or images on the lcd\n"
|
||||||
"color <r> <g> <b> : set the background color of the lcd\r\n"
|
"text \"<text>\" : puts text on the lcd\n"
|
||||||
"textColor <r> <g> <b> : set the color of the text\r\n"
|
"bgColor <r> <g> <b> : set the background color of the lcd\n"
|
||||||
"listImages : shows a list with images in the filesystem\r\n"
|
"color <r> <g> <b> : set the color of the text\n"
|
||||||
"setImage <image_name> : put an image on the screen\r\n"
|
"listFiles : shows a list with images in the filesystem\n"
|
||||||
"setGift <image_name> : put a gif on the screen\r\n"
|
"setImage <image_name> : put an image on the screen\n"
|
||||||
"exit : closes the connection\r\n\n$> \n");
|
"setGif <image_name> : put a gif on the screen\n"
|
||||||
|
"exit : closes the connection\n\n$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\ntcp_write:\nhelp : shows a list of commands\r\n"
|
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n"
|
||||||
"text \"<text>\" : puts text on the lcd\r\n"
|
"help : shows a list of commands\n"
|
||||||
"color <r> <g> <b> : set the background color of the lcd\r\n"
|
"clear text/images : clears the text or images on the lcd\n"
|
||||||
"textColor <r> <g> <b> : set the color of the text\r\n"
|
"text \"<text>\" : puts text on the lcd\n"
|
||||||
"listImages : shows a list with images in the filesystem\r\n"
|
"bgColor <r> <g> <b> : set the background color of the lcd\n"
|
||||||
"setImage <image_name> : put an image on the screen\r\n"
|
"color <r> <g> <b> : set the color of the text\n"
|
||||||
"setGift <image_name> : put a gif on the screen\r\n"
|
"listFiles : shows a list with images in the filesystem\n"
|
||||||
"exit : closes the connection\r\n\n"
|
"setImage <image_name> : put an image on the screen\n"
|
||||||
"tcp_output\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
"setGif <image_name> : put a gif on the screen\n"
|
||||||
|
"exit : closes the connection\n"
|
||||||
|
"\ntcp_output\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "text \"This is printed on the display\"");
|
strcpy(cmd, "text \"This is printed on the display\"");
|
||||||
@@ -92,9 +95,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\nlcd_clear_text\nlcd_display_text @ 10 10 with color 0xFF000000 bg color 0xFF000000\nThis is printed on the display\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\nlcd_display_text @ 10 10 with color 0xFF000000 bg color 0xFF000000\nThis is printed on the display\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "color 0x555555");
|
strcpy(cmd, "color 0x555555");
|
||||||
@@ -104,9 +107,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "bgcolor 0xAAAAAA");
|
strcpy(cmd, "bgcolor 0xAAAAAA");
|
||||||
@@ -116,9 +119,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "text \"This is printed on the display\"");
|
strcpy(cmd, "text \"This is printed on the display\"");
|
||||||
@@ -128,9 +131,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\nlcd_clear_text\nlcd_display_text @ 10 10 with color 0xFF555555 bg color 0xFFAAAAAA\nThis is printed on the display\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\nlcd_display_text @ 10 10 with color 0xFF555555 bg color 0xFFAAAAAA\nThis is printed on the display\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "color 255 255 255");
|
strcpy(cmd, "color 255 255 255");
|
||||||
@@ -140,9 +143,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "bgcolor 255 255 255");
|
strcpy(cmd, "bgcolor 255 255 255");
|
||||||
@@ -152,9 +155,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "text \"This is printed on the display\"");
|
strcpy(cmd, "text \"This is printed on the display\"");
|
||||||
@@ -164,9 +167,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\nlcd_clear_text\nlcd_display_text @ 10 10 with color 0xFFFFFFFF bg color 0xFFFFFFFF\nThis is printed on the display\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\nlcd_display_text @ 10 10 with color 0xFFFFFFFF bg color 0xFFFFFFFF\nThis is printed on the display\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "setImage \"test.bmp\"");
|
strcpy(cmd, "setImage \"test.bmp\"");
|
||||||
@@ -176,9 +179,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\nlcd_clear_images\nlcd_draw_img_from_fs\ntest.bmp @0 0\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\nlcd_draw_img_from_fs\ntest.bmp @0 0\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "setImage \"test.gif\"");
|
strcpy(cmd, "setImage \"test.gif\"");
|
||||||
@@ -188,9 +191,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "File is not a bmp\n\n$> \n");
|
EXPECT_EQ(output, "[Warning] ( 0) [tcp_cmd]: setimage: File is not a bmp\r\nFile is not a bmp\n\n$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\ntcp_write:\nFile is not a bmp\n\ntcp_output\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\nlogger_get_timestamp\n[Warning] ( 0) [tcp_cmd]: setimage: File is not a bmp\r\ntcp_write:\nFile is not a bmp\n\ntcp_output\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "setGif \"test.gif\"");
|
strcpy(cmd, "setGif \"test.gif\"");
|
||||||
@@ -200,9 +203,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "$> \n");
|
EXPECT_EQ(output, "$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\nlcd_clear_images\nlcd_draw_gif_from_fs\ntest.gif @0 0\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\nlcd_draw_gif_from_fs\ntest.gif @0 0\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "setGif \"test.bmp\"");
|
strcpy(cmd, "setGif \"test.bmp\"");
|
||||||
@@ -212,9 +215,9 @@ TEST(TCP_CMD, tcp_data_cb) {
|
|||||||
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
tcp_cmd_recv(NULL, NULL, &p, ERR_OK);
|
||||||
output = testing::internal::GetCapturedStdout();
|
output = testing::internal::GetCapturedStdout();
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
EXPECT_EQ(output, "File is not a gif\n\n$> \n");
|
EXPECT_EQ(output, "[Warning] ( 0) [tcp_cmd]: setgif: File is not a gif\r\nFile is not a gif\n\n$>\n");
|
||||||
#else
|
#else
|
||||||
EXPECT_EQ(output, "tcp_recved\ntcp_write:\nFile is not a gif\n\ntcp_output\ntcp_write:\n$> \ntcp_output\npbuf_free\n");
|
EXPECT_EQ(output, "tcp_recved\nlogger_get_timestamp\n[Warning] ( 0) [tcp_cmd]: setgif: File is not a gif\r\ntcp_write:\nFile is not a gif\n\ntcp_output\ntcp_write:\n$>\ntcp_output\npbuf_free\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcpy(cmd, "exit");
|
strcpy(cmd, "exit");
|
||||||
|
|||||||
Reference in New Issue
Block a user