diff --git a/tests/tcp_cmd.cpp b/tests/tcp_cmd.cpp index 434cc8a..22ec55e 100644 --- a/tests/tcp_cmd.cpp +++ b/tests/tcp_cmd.cpp @@ -65,24 +65,27 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "help : shows a list of commands\r\n" - "text \"\" : puts text on the lcd\r\n" - "color : set the background color of the lcd\r\n" - "textColor : set the color of the text\r\n" - "listImages : shows a list with images in the filesystem\r\n" - "setImage : put an image on the screen\r\n" - "setGift : put a gif on the screen\r\n" - "exit : closes the connection\r\n\n$> \n"); + EXPECT_EQ(output, "help : shows a list of commands\n" + "clear text/images : clears the text or images on the lcd\n" + "text \"\" : puts text on the lcd\n" + "bgColor : set the background color of the lcd\n" + "color : set the color of the text\n" + "listFiles : shows a list with images in the filesystem\n" + "setImage : put an image on the screen\n" + "setGif : put a gif on the screen\n" + "exit : closes the connection\n\n$>\n"); #else - EXPECT_EQ(output, "tcp_recved\ntcp_write:\nhelp : shows a list of commands\r\n" - "text \"\" : puts text on the lcd\r\n" - "color : set the background color of the lcd\r\n" - "textColor : set the color of the text\r\n" - "listImages : shows a list with images in the filesystem\r\n" - "setImage : put an image on the screen\r\n" - "setGift : put a gif on the screen\r\n" - "exit : closes the connection\r\n\n" - "tcp_output\ntcp_write:\n$> \ntcp_output\npbuf_free\n"); + EXPECT_EQ(output, "tcp_recved\ntcp_write:\n" + "help : shows a list of commands\n" + "clear text/images : clears the text or images on the lcd\n" + "text \"\" : puts text on the lcd\n" + "bgColor : set the background color of the lcd\n" + "color : set the color of the text\n" + "listFiles : shows a list with images in the filesystem\n" + "setImage : put an image on the screen\n" + "setGif : put a gif on the screen\n" + "exit : closes the connection\n" + "\ntcp_output\ntcp_write:\n$>\ntcp_output\npbuf_free\n"); #endif 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); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 strcpy(cmd, "color 0x555555"); @@ -104,9 +107,9 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 strcpy(cmd, "bgcolor 0xAAAAAA"); @@ -116,9 +119,9 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 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); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 strcpy(cmd, "color 255 255 255"); @@ -140,9 +143,9 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 strcpy(cmd, "bgcolor 255 255 255"); @@ -152,9 +155,9 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 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); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 strcpy(cmd, "setImage \"test.bmp\""); @@ -176,9 +179,9 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 strcpy(cmd, "setImage \"test.gif\""); @@ -188,9 +191,9 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #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 - 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 strcpy(cmd, "setGif \"test.gif\""); @@ -200,9 +203,9 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #ifndef DEBUG - EXPECT_EQ(output, "$> \n"); + EXPECT_EQ(output, "$>\n"); #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 strcpy(cmd, "setGif \"test.bmp\""); @@ -212,9 +215,9 @@ TEST(TCP_CMD, tcp_data_cb) { tcp_cmd_recv(NULL, NULL, &p, ERR_OK); output = testing::internal::GetCapturedStdout(); #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 - 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 strcpy(cmd, "exit");