diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-09-14 15:23:54 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-09-14 15:23:54 +0000 |
commit | f2e87a71aed19603c7d2701f4b8a20cbf8b74ce2 (patch) | |
tree | e4b9f818b34d1c46da39d8c53e09a18435dcbb98 /NxWidgets | |
parent | b12d1dada94cd7083c2a5a023ec2e7a9a51c192a (diff) | |
download | px4-nuttx-f2e87a71aed19603c7d2701f4b8a20cbf8b74ce2.tar.gz px4-nuttx-f2e87a71aed19603c7d2701f4b8a20cbf8b74ce2.tar.bz2 px4-nuttx-f2e87a71aed19603c7d2701f4b8a20cbf8b74ce2.zip |
Update all unit tests to conform to recent naming convention changes in NuttX
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5151 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets')
53 files changed, 308 insertions, 484 deletions
diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index b74ba32bc..cdd26cb89 100644 --- a/NxWidgets/ChangeLog.txt +++ b/NxWidgets/ChangeLog.txt @@ -159,3 +159,7 @@ recent check-ins. 1.3 2012-xx-xx Gregory Nutt <gnutt@nuttx.org> + +* UnitTests/*/main.cxx: Change entry point name to be consistent + with with entry point naming conventions introduced in NuttX + 6.22. diff --git a/NxWidgets/UnitTests/CButton/Makefile b/NxWidgets/UnitTests/CButton/Makefile index 4e1ae042f..77ba7e986 100644 --- a/NxWidgets/UnitTests/CButton/Makefile +++ b/NxWidgets/UnitTests/CButton/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cbuttontest.cxx +CXXSRCS = cbutton_main.cxx cbuttontest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CButton/main.cxx b/NxWidgets/UnitTests/CButton/cbutton_main.cxx index 13e9099d9..973a2cd8a 100644 --- a/NxWidgets/UnitTests/CButton/main.cxx +++ b/NxWidgets/UnitTests/CButton/cbutton_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CButton/main.cxx +// NxWidgets/UnitTests/CButton/cbutton_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -68,7 +68,7 @@ static const char g_pushme[] = "Push Me"; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cbutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Public Functions @@ -78,29 +78,29 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cbutton_main(int argc, char *argv[]) { // Create an instance of the font test - printf(MAIN_STRING "Create CButtonTest instance\n"); + printf("cbutton_main: Create CButtonTest instance\n"); CButtonTest *test = new CButtonTest(); // Connect the NX server - printf(MAIN_STRING "Connect the CButtonTest instance to the NX server\n"); + printf("cbutton_main: Connect the CButtonTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CButtonTest instance to the NX server\n"); + printf("cbutton_main: Failed to connect the CButtonTest instance to the NX server\n"); delete test; return 1; } // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("cbutton_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("cbutton_main: Failed to create a window\n"); delete test; return 1; } @@ -110,26 +110,26 @@ int MAIN_NAME(int argc, char *argv[]) CButton *button = test->createButton(g_pushme); if (!button) { - printf(MAIN_STRING "Failed to create a button\n"); + printf("cbutton_main: Failed to create a button\n"); delete test; return 1; } // Show the button - printf(MAIN_STRING "Show the button\n"); + printf("cbutton_main: Show the button\n"); test->showButton(button); // Wait two seconds, then perform a simulated mouse click on the button sleep(2); - printf(MAIN_STRING "Click the button\n"); + printf("cbutton_main: Click the button\n"); test->click(); // Poll for the mouse click event (of course this can hang if something fails) bool clicked = test->poll(button); - printf(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + printf("cbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a second, then release the mouse buttone @@ -139,7 +139,7 @@ int MAIN_NAME(int argc, char *argv[]) // Poll for the mouse release event (of course this can hang if something fails) clicked = test->poll(button); - printf(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + printf("cbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a few more seconds so that the tester can ponder the result @@ -147,7 +147,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("cbutton_main: Clean-up and exit\n"); delete button; delete test; return 0; diff --git a/NxWidgets/UnitTests/CButton/cbuttontest.hxx b/NxWidgets/UnitTests/CButton/cbuttontest.hxx index cba947b73..10465c06e 100644 --- a/NxWidgets/UnitTests/CButton/cbuttontest.hxx +++ b/NxWidgets/UnitTests/CButton/cbuttontest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cbutton_main -# define MAIN_STRING "cbutton_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/NxWidgets/UnitTests/CButtonArray/Makefile b/NxWidgets/UnitTests/CButtonArray/Makefile index a37e49142..a5a33b3b0 100644 --- a/NxWidgets/UnitTests/CButtonArray/Makefile +++ b/NxWidgets/UnitTests/CButtonArray/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cbuttonarraytest.cxx +CXXSRCS = cbuttonarray_main.cxx cbuttonarraytest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CButtonArray/main.cxx b/NxWidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx index fa02413a4..c247d73e5 100644 --- a/NxWidgets/UnitTests/CButtonArray/main.cxx +++ b/NxWidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CButtonArray/main.cxx +// NxWidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -82,7 +82,7 @@ static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cbuttonarray_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -196,7 +196,7 @@ static void checkHighlighting(CButtonArray *buttonArray) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cbuttonarray_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -204,16 +204,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the button array test - printf(MAIN_STRING "Create CButtonArrayTest instance\n"); + printf("cbuttonarray_main: Create CButtonArrayTest instance\n"); CButtonArrayTest *test = new CButtonArrayTest(); updateMemoryUsage(g_mmPrevious, "After creating CButtonArrayTest"); // Connect the NX server - printf(MAIN_STRING "Connect the CButtonArrayTest instance to the NX server\n"); + printf("cbuttonarray_main: Connect the CButtonArrayTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CButtonArrayTest instance to the NX server\n"); + printf("cbuttonarray_main: Failed to connect the CButtonArrayTest instance to the NX server\n"); delete test; return 1; } @@ -221,10 +221,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("cbuttonarray_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("cbuttonarray_main: Failed to create a window\n"); delete test; return 1; } @@ -235,7 +235,7 @@ int MAIN_NAME(int argc, char *argv[]) CButtonArray *buttonArray = test->createButtonArray(); if (!buttonArray) { - printf(MAIN_STRING "Failed to create a button array\n"); + printf("cbuttonarray_main: Failed to create a button array\n"); delete test; return 1; } @@ -248,7 +248,7 @@ int MAIN_NAME(int argc, char *argv[]) { for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) { - printf(MAIN_STRING "Label (%d,%d): %s\n", i, j, *ptr); + printf("cbuttonarray_main: Label (%d,%d): %s\n", i, j, *ptr); CNxString string = *ptr++; buttonArray->setText(i, j, string); } @@ -257,7 +257,7 @@ int MAIN_NAME(int argc, char *argv[]) // Show the button array - printf(MAIN_STRING "Show the button array\n"); + printf("cbuttonarray_main: Show the button array\n"); test->showButton(buttonArray); sleep(1); @@ -272,7 +272,7 @@ int MAIN_NAME(int argc, char *argv[]) { for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) { - printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + printf("cbuttonarray_main: Click the button (%d,%d)\n", i, j); test->click(buttonArray, i, j); // Poll for the mouse click event @@ -285,13 +285,13 @@ int MAIN_NAME(int argc, char *argv[]) int clickRow; if (buttonArray->isButtonClicked(clickColumn, clickRow)) { - printf(MAIN_STRING "%s: Button (%d, %d) is clicked\n", + printf("cbuttonarray_main: %s: Button (%d, %d) is clicked\n", clickColumn == i && clickRow == j ? "OK" : "ERROR", clickColumn, clickRow); } else { - printf(MAIN_STRING "ERROR: No button is clicked\n"); + printf("cbuttonarray_main: ERROR: No button is clicked\n"); } // Wait a bit, then release the mouse button @@ -304,7 +304,7 @@ int MAIN_NAME(int argc, char *argv[]) test->poll(buttonArray); if (buttonArray->isButtonClicked(clickColumn, clickRow)) { - printf(MAIN_STRING "ERROR: Button (%d, %d) is clicked\n", + printf("cbuttonarray_main: ERROR: Button (%d, %d) is clicked\n", clickColumn, clickRow); } @@ -315,7 +315,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("cbuttonarray_main: Clean-up and exit\n"); delete buttonArray; updateMemoryUsage(g_mmPrevious, "After deleting the button array"); delete test; diff --git a/NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx b/NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx index 1a75ac2c3..b8a9e15e5 100644 --- a/NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx +++ b/NxWidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cbuttonarray_main -# define MAIN_STRING "cbuttonarray_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CCheckBox/Makefile b/NxWidgets/UnitTests/CCheckBox/Makefile index 6b31286df..9b46cef8d 100644 --- a/NxWidgets/UnitTests/CCheckBox/Makefile +++ b/NxWidgets/UnitTests/CCheckBox/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx ccheckboxtest.cxx +CXXSRCS = ccheckbox_main.cxx ccheckboxtest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CCheckBox/main.cxx b/NxWidgets/UnitTests/CCheckBox/ccheckbox_main.cxx index e9e8b516f..949cbc35f 100644 --- a/NxWidgets/UnitTests/CCheckBox/main.cxx +++ b/NxWidgets/UnitTests/CCheckBox/ccheckbox_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CCheckBox/main.cxx +// NxWidgets/UnitTests/CCheckBox/ccheckbox_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int ccheckbox_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int ccheckbox_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,31 +143,31 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CCheckBoxTest instance\n"); + message("ccheckbox_main: Create CCheckBoxTest instance\n"); CCheckBoxTest *test = new CCheckBoxTest(); updateMemoryUsage(g_mmprevious, "After creating CCheckBoxTest"); // Connect the NX server - message(MAIN_STRING "Connect the CCheckBoxTest instance to the NX server\n"); + message("ccheckbox_main: Connect the CCheckBoxTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CCheckBoxTest instance to the NX server\n"); + message("ccheckbox_main: Failed to connect the CCheckBoxTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "ccheckbox_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("ccheckbox_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("ccheckbox_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "ccheckbox_main: After creating a window"); // Show the initial state of the checkbox @@ -177,21 +177,21 @@ int MAIN_NAME(int argc, char *argv[]) // Now click the checkbox - message(MAIN_STRING "Click 1\n"); + message("ccheckbox_main: Click 1\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); updateMemoryUsage(g_mmprevious, "After click 1"); usleep(500*1000); - message(MAIN_STRING "Click 2\n"); + message("ccheckbox_main: Click 2\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); updateMemoryUsage(g_mmprevious, "After click 2"); usleep(500*1000); - message(MAIN_STRING "Click 3\n"); + message("ccheckbox_main: Click 3\n"); test->clickCheckBox(); usleep(500*1000); test->showCheckBoxState(); @@ -200,7 +200,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("ccheckbox_main: Clean-up and exit\n"); delete test; updateMemoryUsage(g_mmprevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); diff --git a/NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx b/NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx index 73e72e282..0397b37dd 100644 --- a/NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx +++ b/NxWidgets/UnitTests/CCheckBox/ccheckboxtest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CCHECKBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME ccheckbox_main -# define MAIN_STRING "ccheckbox_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CGlyphButton/Makefile b/NxWidgets/UnitTests/CGlyphButton/Makefile index 01e843555..5f2522e49 100644 --- a/NxWidgets/UnitTests/CGlyphButton/Makefile +++ b/NxWidgets/UnitTests/CGlyphButton/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cglyphbuttontest.cxx +CXXSRCS = cglyphbutton_main.cxx cglyphbuttontest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CGlyphButton/main.cxx b/NxWidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx index 7812fa9e9..95e255dcc 100644 --- a/NxWidgets/UnitTests/CGlyphButton/main.cxx +++ b/NxWidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CGlyphButton/main.cxx +// NxWidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -72,7 +72,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cglyphbutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -134,7 +134,7 @@ static void initMemoryUsage(void) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cglyphbutton_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -142,16 +142,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the font test - message(MAIN_STRING "Create CGlyphButtonTest instance\n"); + message("cglyphbutton_main: Create CGlyphButtonTest instance\n"); CGlyphButtonTest *test = new CGlyphButtonTest(); updateMemoryUsage(g_mmprevious, "After creating CGlyphButtonTest"); // Connect the NX server - message(MAIN_STRING "Connect the CGlyphButtonTest instance to the NX server\n"); + message("cglyphbutton_main: Connect the CGlyphButtonTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CGlyphButtonTest instance to the NX server\n"); + message("cglyphbutton_main: Failed to connect the CGlyphButtonTest instance to the NX server\n"); delete test; return 1; } @@ -159,10 +159,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cglyphbutton_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cglyphbutton_main: Failed to create a window\n"); delete test; return 1; } @@ -173,7 +173,7 @@ int MAIN_NAME(int argc, char *argv[]) CGlyphButton *button = test->createButton(&g_arrowDown, &g_arrowUp); if (!button) { - message(MAIN_STRING "Failed to create a button\n"); + message("cglyphbutton_main: Failed to create a button\n"); delete test; return 1; } @@ -181,21 +181,21 @@ int MAIN_NAME(int argc, char *argv[]) // Show the button - message(MAIN_STRING "Show the button\n"); + message("cglyphbutton_main: Show the button\n"); test->showButton(button); updateMemoryUsage(g_mmprevious, "After showing the glyph button"); // Wait two seconds, then perform a simulated mouse click on the button sleep(2); - message(MAIN_STRING "Click the button\n"); + message("cglyphbutton_main: Click the button\n"); test->click(); updateMemoryUsage(g_mmprevious, "After clicking glyph button"); // Poll for the mouse click event (of course this can hang if something fails) bool clicked = test->poll(button); - message(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + message("cglyphbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a second, then release the mouse buttone @@ -206,7 +206,7 @@ int MAIN_NAME(int argc, char *argv[]) // Poll for the mouse release event (of course this can hang if something fails) clicked = test->poll(button); - message(MAIN_STRING "Button is %s\n", clicked ? "clicked" : "released"); + message("cglyphbutton_main: Button is %s\n", clicked ? "clicked" : "released"); // Wait a few more seconds so that the tester can ponder the result @@ -214,7 +214,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cglyphbutton_main: Clean-up and exit\n"); delete button; updateMemoryUsage(g_mmprevious, "After deleting the glyph button"); delete test; diff --git a/NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx b/NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx index 940d82a9f..b3e5bb656 100644 --- a/NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx +++ b/NxWidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx @@ -76,16 +76,6 @@ # define CONFIG_CGLYPHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cglyphbutton_main -# define MAIN_STRING "cglyphbutton_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CImage/Makefile b/NxWidgets/UnitTests/CImage/Makefile index 8db783364..46e69c495 100644 --- a/NxWidgets/UnitTests/CImage/Makefile +++ b/NxWidgets/UnitTests/CImage/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cimagetest.cxx +CXXSRCS = cimage_main.cxx cimagetest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CImage/main.cxx b/NxWidgets/UnitTests/CImage/cimage_main.cxx index dd066b809..30cf49d3e 100644 --- a/NxWidgets/UnitTests/CImage/main.cxx +++ b/NxWidgets/UnitTests/CImage/cimage_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CImage/main.cxx +// NxWidgets/UnitTests/CImage/cimage_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -73,7 +73,7 @@ static struct mallinfo g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cimage_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -149,7 +149,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cimage_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -157,16 +157,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the font test - message(MAIN_STRING "Create CImageTest instance\n"); + message("cimage_main: Create CImageTest instance\n"); CImageTest *test = new CImageTest(); updateMemoryUsage(&g_mmprevious, "After creating CImageTest"); // Connect the NX server - message(MAIN_STRING "Connect the CImageTest instance to the NX server\n"); + message("cimage_main: Connect the CImageTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CImageTest instance to the NX server\n"); + message("cimage_main: Failed to connect the CImageTest instance to the NX server\n"); delete test; return 1; } @@ -174,10 +174,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cimage_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cimage_main: Failed to create a window\n"); delete test; return 1; } @@ -193,7 +193,7 @@ int MAIN_NAME(int argc, char *argv[]) CImage *image = test->createImage(static_cast<IBitmap*>(nuttxBitmap)); if (!image) { - message(MAIN_STRING "Failed to create a image\n"); + message("cimage_main: Failed to create a image\n"); delete test; return 1; } @@ -207,7 +207,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cimage_main: Clean-up and exit\n"); delete image; updateMemoryUsage(&g_mmprevious, "After deleting CImage"); diff --git a/NxWidgets/UnitTests/CImage/cimagetest.hxx b/NxWidgets/UnitTests/CImage/cimagetest.hxx index 64592ee23..9592f2936 100644 --- a/NxWidgets/UnitTests/CImage/cimagetest.hxx +++ b/NxWidgets/UnitTests/CImage/cimagetest.hxx @@ -71,16 +71,6 @@ # define CONFIG_CIMAGETEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cimage_main -# define MAIN_STRING "cimage_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CKeypad/Makefile b/NxWidgets/UnitTests/CKeypad/Makefile index ddb8fb962..3d37c26fe 100644 --- a/NxWidgets/UnitTests/CKeypad/Makefile +++ b/NxWidgets/UnitTests/CKeypad/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx ckeypadtest.cxx +CXXSRCS = ckeypad_main.cxx ckeypadtest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CKeypad/main.cxx b/NxWidgets/UnitTests/CKeypad/ckeypad_main.cxx index 1c7679ee2..896ef5013 100644 --- a/NxWidgets/UnitTests/CKeypad/main.cxx +++ b/NxWidgets/UnitTests/CKeypad/ckeypad_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CKeypad/main.cxx +// NxWidgets/UnitTests/CKeypad/ckeypad_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -72,7 +72,7 @@ static unsigned int g_mmPeak; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int ckeypad_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -142,7 +142,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) { for (int i = 0; i < KEYPAD_NCOLUMNS; i++) { - printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + printf("clickButtons: Click the button (%d,%d)\n", i, j); test->click(keypad, i, j); // Poll for the mouse click event @@ -155,13 +155,13 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) int clickRow; if (keypad->isButtonClicked(clickColumn, clickRow)) { - printf(MAIN_STRING "%s: Button (%d, %d) is clicked\n", + printf("clickButtons: %s: Button (%d, %d) is clicked\n", clickColumn == i && clickRow == j ? "OK" : "ERROR", clickColumn, clickRow); } else { - printf(MAIN_STRING "ERROR: No button is clicked\n"); + printf("clickButtons: ERROR: No button is clicked\n"); } // Wait a bit, then release the mouse button @@ -174,7 +174,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) test->poll(keypad); if (keypad->isButtonClicked(clickColumn, clickRow)) { - printf(MAIN_STRING "ERROR: Button (%d, %d) is clicked\n", + printf("clickButtons: ERROR: Button (%d, %d) is clicked\n", clickColumn, clickRow); } @@ -192,7 +192,7 @@ static void clickButtons(CKeypadTest *test, CKeypad *keypad) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int ckeypad_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -200,16 +200,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the keypad test - printf(MAIN_STRING "Create CKeypadTest instance\n"); + printf("ckeypad_main: Create CKeypadTest instance\n"); CKeypadTest *test = new CKeypadTest(); updateMemoryUsage(g_mmPrevious, "After creating CKeypadTest"); // Connect the NX server - printf(MAIN_STRING "Connect the CKeypadTest instance to the NX server\n"); + printf("ckeypad_main: Connect the CKeypadTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CKeypadTest instance to the NX server\n"); + printf("ckeypad_main: Failed to connect the CKeypadTest instance to the NX server\n"); delete test; return 1; } @@ -217,10 +217,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("ckeypad_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("ckeypad_main: Failed to create a window\n"); delete test; return 1; } @@ -231,7 +231,7 @@ int MAIN_NAME(int argc, char *argv[]) CKeypad *keypad = test->createKeypad(); if (!keypad) { - printf(MAIN_STRING "Failed to create a keypad\n"); + printf("ckeypad_main: Failed to create a keypad\n"); delete test; return 1; } @@ -239,7 +239,7 @@ int MAIN_NAME(int argc, char *argv[]) // Show the keypad in alphabetic mode - printf(MAIN_STRING "Show the keypad in alphabetic mode\n"); + printf("ckeypad_main: Show the keypad in alphabetic mode\n"); keypad->setKeypadMode(false); test->showKeypad(keypad); sleep(1); @@ -251,7 +251,7 @@ int MAIN_NAME(int argc, char *argv[]) // Show the keypad in numeric mode - printf(MAIN_STRING "Show the keypad in numeric mode\n"); + printf("ckeypad_main: Show the keypad in numeric mode\n"); keypad->setKeypadMode(true); sleep(1); @@ -262,7 +262,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("ckeypad_main: Clean-up and exit\n"); delete keypad; updateMemoryUsage(g_mmPrevious, "After deleting the keypad"); delete test; diff --git a/NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx b/NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx index c1c7ba79e..d11c92375 100644 --- a/NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx +++ b/NxWidgets/UnitTests/CKeypad/ckeypadtest.hxx @@ -72,16 +72,6 @@ # define CONFIG_CKEYPADTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME ckeypad_main -# define MAIN_STRING "ckeypad_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CLabel/Makefile b/NxWidgets/UnitTests/CLabel/Makefile index 4e49a7f5c..e04adc7de 100644 --- a/NxWidgets/UnitTests/CLabel/Makefile +++ b/NxWidgets/UnitTests/CLabel/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx clabeltest.cxx +CXXSRCS = clabel_main.cxx clabeltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CLabel/main.cxx b/NxWidgets/UnitTests/CLabel/clabel_main.cxx index 953e6afbc..2b800dcab 100644 --- a/NxWidgets/UnitTests/CLabel/main.cxx +++ b/NxWidgets/UnitTests/CLabel/clabel_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CLabel/main.cxx +// NxWidgets/UnitTests/CLabel/clabel_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -68,7 +68,7 @@ static const char g_hello[] = "Hello, World!"; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int clabel_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Public Functions @@ -78,29 +78,29 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int clabel_main(int argc, char *argv[]) { // Create an instance of the font test - printf(MAIN_STRING "Create CLabelTest instance\n"); + printf("clabel_main: Create CLabelTest instance\n"); CLabelTest *test = new CLabelTest(); // Connect the NX server - printf(MAIN_STRING "Connect the CLabelTest instance to the NX server\n"); + printf("clabel_main: Connect the CLabelTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CLabelTest instance to the NX server\n"); + printf("clabel_main: Failed to connect the CLabelTest instance to the NX server\n"); delete test; return 1; } // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("clabel_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("clabel_main: Failed to create a window\n"); delete test; return 1; } @@ -110,7 +110,7 @@ int MAIN_NAME(int argc, char *argv[]) CLabel *label = test->createLabel(g_hello); if (!label) { - printf(MAIN_STRING "Failed to create a label\n"); + printf("clabel_main: Failed to create a label\n"); delete test; return 1; } @@ -122,7 +122,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("clabel_main: Clean-up and exit\n"); delete label; delete test; return 0; diff --git a/NxWidgets/UnitTests/CLabel/clabeltest.hxx b/NxWidgets/UnitTests/CLabel/clabeltest.hxx index f7e13fdfb..47bb7684b 100644 --- a/NxWidgets/UnitTests/CLabel/clabeltest.hxx +++ b/NxWidgets/UnitTests/CLabel/clabeltest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CLABELTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME clabel_main -# define MAIN_STRING "clabel_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/NxWidgets/UnitTests/CLatchButton/Makefile b/NxWidgets/UnitTests/CLatchButton/Makefile index d953c3e99..7444c50be 100644 --- a/NxWidgets/UnitTests/CLatchButton/Makefile +++ b/NxWidgets/UnitTests/CLatchButton/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx clatchbuttontest.cxx +CXXSRCS = clatchbutton_main.cxx clatchbuttontest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CLatchButton/main.cxx b/NxWidgets/UnitTests/CLatchButton/clatchbutton_main.cxx index d51f613c1..13ed0613e 100644 --- a/NxWidgets/UnitTests/CLatchButton/main.cxx +++ b/NxWidgets/UnitTests/CLatchButton/clatchbutton_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CLatchButton/main.cxx +// NxWidgets/UnitTests/CLatchButton/clatchbutton_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -68,7 +68,7 @@ static const char g_pushme[] = "Push Me"; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int clatchbutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -83,13 +83,13 @@ static void showButtonState(CLatchButton *button, bool &clicked, bool &latched) bool nowClicked = button->isClicked(); bool nowLatched = button->isLatched(); - printf(MAIN_STRING "Button state: %s and %s\n", + printf("showButtonState: Button state: %s and %s\n", nowClicked ? "clicked" : "released", nowLatched ? "latched" : "unlatched"); if (clicked != nowClicked || latched != nowLatched) { - printf(MAIN_STRING "ERROR: Expected %s and %s\n", + printf("showButtonState: ERROR: Expected %s and %s\n", clicked ? "clicked" : "released", latched ? "latched" : "unlatched"); @@ -106,29 +106,29 @@ static void showButtonState(CLatchButton *button, bool &clicked, bool &latched) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int clatchbutton_main(int argc, char *argv[]) { // Create an instance of the font test - printf(MAIN_STRING "Create CLatchButtonTest instance\n"); + printf("clatchbutton_main: Create CLatchButtonTest instance\n"); CLatchButtonTest *test = new CLatchButtonTest(); // Connect the NX server - printf(MAIN_STRING "Connect the CLatchButtonTest instance to the NX server\n"); + printf("clatchbutton_main: Connect the CLatchButtonTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CLatchButtonTest instance to the NX server\n"); + printf("clatchbutton_main: Failed to connect the CLatchButtonTest instance to the NX server\n"); delete test; return 1; } // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("clatchbutton_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("clatchbutton_main: Failed to create a window\n"); delete test; return 1; } @@ -138,14 +138,14 @@ int MAIN_NAME(int argc, char *argv[]) CLatchButton *button = test->createButton(g_pushme); if (!button) { - printf(MAIN_STRING "Failed to create a button\n"); + printf("clatchbutton_main: Failed to create a button\n"); delete test; return 1; } // Show the button - printf(MAIN_STRING "Show the button\n"); + printf("clatchbutton_main: Show the button\n"); test->showButton(button); bool clicked = false; @@ -159,7 +159,7 @@ int MAIN_NAME(int argc, char *argv[]) // Wait two seconds, then perform a simulated mouse click on the button sleep(2); - printf(MAIN_STRING "Click the button\n"); + printf("clatchbutton_main: Click the button\n"); test->click(); test->poll(button); @@ -173,7 +173,7 @@ int MAIN_NAME(int argc, char *argv[]) // And release the button after 0.5 seconds usleep(500 * 1000); - printf(MAIN_STRING "Release the button\n"); + printf("clatchbutton_main: Release the button\n"); test->release(); test->poll(button); @@ -191,7 +191,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("clatchbutton_main: Clean-up and exit\n"); delete button; delete test; return 0; diff --git a/NxWidgets/UnitTests/CLatchButton/clatchbuttontest.hxx b/NxWidgets/UnitTests/CLatchButton/clatchbuttontest.hxx index 62405ac88..783b1a57c 100644 --- a/NxWidgets/UnitTests/CLatchButton/clatchbuttontest.hxx +++ b/NxWidgets/UnitTests/CLatchButton/clatchbuttontest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CLATCHBUTTONTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME clatchbutton_main -# define MAIN_STRING "clatchbutton_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/NxWidgets/UnitTests/CLatchButtonArray/Makefile b/NxWidgets/UnitTests/CLatchButtonArray/Makefile index ddd44f8b3..a6ac9118b 100644 --- a/NxWidgets/UnitTests/CLatchButtonArray/Makefile +++ b/NxWidgets/UnitTests/CLatchButtonArray/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx clatchbuttonarraytest.cxx +CXXSRCS = clatchbuttonarray_main.cxx clatchbuttonarraytest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CLatchButtonArray/main.cxx b/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx index d38651ae9..ad7646560 100644 --- a/NxWidgets/UnitTests/CLatchButtonArray/main.cxx +++ b/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CLatchButtonArray/main.cxx +// NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarry_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -82,7 +82,7 @@ static FAR const char *g_buttonLabels[BUTTONARRAY_NCOLUMNS*BUTTONARRAY_NROWS] = // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int clatchbuttonarray_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -98,14 +98,14 @@ static void showButtonState(CLatchButtonArray *buttonArray, int i, int j, bool nowClicked = buttonArray->isThisButtonClicked(i,j); bool nowLatched = buttonArray->isThisButtonLatched(i,j); - printf(MAIN_STRING "Button(%d,%d) state: %s and %s\n", + printf("showButtonState: Button(%d,%d) state: %s and %s\n", i, j, nowClicked ? "clicked" : "released", nowLatched ? "latched" : "unlatched"); if (clicked != nowClicked || latched != nowLatched) { - printf(MAIN_STRING "ERROR: Expected %s and %s\n", + printf("showButtonState: ERROR: Expected %s and %s\n", clicked ? "clicked" : "released", latched ? "latched" : "unlatched"); @@ -174,7 +174,7 @@ static void initMemoryUsage(void) // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int clatchbuttonarray_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -182,16 +182,16 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the button array test - printf(MAIN_STRING "Create CLatchButtonArrayTest instance\n"); + printf("clatchbuttonarray_main: Create CLatchButtonArrayTest instance\n"); CLatchButtonArrayTest *test = new CLatchButtonArrayTest(); updateMemoryUsage(g_mmPrevious, "After creating CLatchButtonArrayTest"); // Connect the NX server - printf(MAIN_STRING "Connect the CLatchButtonArrayTest instance to the NX server\n"); + printf("clatchbuttonarray_main: Connect the CLatchButtonArrayTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CLatchButtonArrayTest instance to the NX server\n"); + printf("clatchbuttonarray_main: Failed to connect the CLatchButtonArrayTest instance to the NX server\n"); delete test; return 1; } @@ -199,10 +199,10 @@ int MAIN_NAME(int argc, char *argv[]) // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("clatchbuttonarray_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("clatchbuttonarray_main: Failed to create a window\n"); delete test; return 1; } @@ -213,7 +213,7 @@ int MAIN_NAME(int argc, char *argv[]) CLatchButtonArray *buttonArray = test->createButtonArray(); if (!buttonArray) { - printf(MAIN_STRING "Failed to create a button array\n"); + printf("clatchbuttonarray_main: Failed to create a button array\n"); delete test; return 1; } @@ -226,7 +226,7 @@ int MAIN_NAME(int argc, char *argv[]) { for (int i = 0; i < BUTTONARRAY_NCOLUMNS; i++) { - printf(MAIN_STRING "Label (%d,%d): %s\n", i, j, *ptr); + printf("clatchbuttonarray_main: Label (%d,%d): %s\n", i, j, *ptr); CNxString string = *ptr++; buttonArray->setText(i, j, string); } @@ -235,7 +235,7 @@ int MAIN_NAME(int argc, char *argv[]) // Show the button array - printf(MAIN_STRING "Show the button array\n"); + printf("clatchbuttonarray_main: Show the button array\n"); test->showButton(buttonArray); sleep(1); @@ -254,7 +254,7 @@ int MAIN_NAME(int argc, char *argv[]) latched = false; showButtonState(buttonArray, i, j, clicked, latched); - printf(MAIN_STRING "Click the button (%d,%d)\n", i, j); + printf("clatchbuttonarray_main: Click the button (%d,%d)\n", i, j); test->click(buttonArray, i, j); // Poll for the mouse click event @@ -289,7 +289,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - printf(MAIN_STRING "Clean-up and exit\n"); + printf("clatchbuttonarray_main: Clean-up and exit\n"); delete buttonArray; updateMemoryUsage(g_mmPrevious, "After deleting the button array"); delete test; diff --git a/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx b/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx index f8642f089..98c0a3bb3 100644 --- a/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx +++ b/NxWidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CLATCHBUTTONARRAYTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME clatchbuttonarray_main -# define MAIN_STRING "clatchbuttonarray_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CListBox/Makefile b/NxWidgets/UnitTests/CListBox/Makefile index 4f933ad98..f06873817 100644 --- a/NxWidgets/UnitTests/CListBox/Makefile +++ b/NxWidgets/UnitTests/CListBox/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx clistboxtest.cxx +CXXSRCS = clistbox_main.cxx clistboxtest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CListBox/main.cxx b/NxWidgets/UnitTests/CListBox/clistbox_main.cxx index 5783e255d..8711f06e8 100644 --- a/NxWidgets/UnitTests/CListBox/main.cxx +++ b/NxWidgets/UnitTests/CListBox/clistbox_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CListBox/main.cxx +// NxWidgets/UnitTests/CListBox/clistbox_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -108,7 +108,7 @@ static FAR const char *g_options[] = // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int clistbox_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -174,7 +174,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int clistbox_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -182,43 +182,43 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the listbox test - message(MAIN_STRING "Create CListBoxTest instance\n"); + message("clistbox_main: Create CListBoxTest instance\n"); CListBoxTest *test = new CListBoxTest(); updateMemoryUsage(g_mmPrevious, "After creating CListBoxTest"); // Connect the NX server - message(MAIN_STRING "Connect the CListBoxTest instance to the NX server\n"); + message("clistbox_main: Connect the CListBoxTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CListBoxTest instance to the NX server\n"); + message("clistbox_main: Failed to connect the CListBoxTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("clistbox_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("clistbox_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After creating a window"); // Create a listbox - message(MAIN_STRING "Create a ListBox\n"); + message("clistbox_main: Create a ListBox\n"); CListBox *listbox = test->createListBox(); if (!listbox) { - message(MAIN_STRING "Failed to create a listbox\n"); + message("clistbox_main: Failed to create a listbox\n"); delete test; return 1; } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After creating a listbox"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After creating a listbox"); // Show the initial state of the listbox @@ -228,23 +228,23 @@ int MAIN_NAME(int argc, char *argv[]) // Now add items to the list box (in reverse alphabetical order) - message(MAIN_STRING "Add options to the ListBox\n"); + message("clistbox_main: Add options to the ListBox\n"); for (int i = NOPTIONS - 1; i >= 0; i--) { listbox->addOption(g_options[i],i); test->showListBox(listbox); - message(MAIN_STRING "%d. New option %s\n", i, g_options[i]); + message("clistbox_main: %d. New option %s\n", i, g_options[i]); usleep(500000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After adding the listbox items"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After adding the listbox items"); sleep(1); // Sort the list box - message(MAIN_STRING "Sort the ListBox\n"); + message("clistbox_main: Sort the ListBox\n"); listbox->sort(); test->showListBox(listbox); - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After sorting the listbox"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After sorting the listbox"); sleep(1); // Select and remove items from the listbox @@ -253,69 +253,69 @@ int MAIN_NAME(int argc, char *argv[]) int nOptions; while ((nOptions = listbox->getOptionCount()) > 0) { - message(MAIN_STRING "Option count: %d\n", nOptions); + message("clistbox_main: Option count: %d\n", nOptions); if (nOptions <= 5) { - message(MAIN_STRING "Selecting all remaining options\n"); + message("clistbox_main: Selecting all remaining options\n"); listbox->selectAllOptions(); test->showListBox(listbox); - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After selecting all options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After selecting all options"); sleep(1); - message(MAIN_STRING "Removing all remaining options\n"); + message("clistbox_main: Removing all remaining options\n"); listbox->removeAllOptions(); - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After removing all options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After removing all options"); test->showListBox(listbox); } else { int selected[5]; - message(MAIN_STRING "Selecting five options\n"); + message("clistbox_main: Selecting five options\n"); for (int i = 0; i < 5; i++) { selected[i] = ((nOptions - 1) * rand()) / MAX_RAND; - message(MAIN_STRING "Selecting option %d\n", selected[i]); + message("clistbox_main: Selecting option %d\n", selected[i]); listbox->removeOption(selected[i]); test->showListBox(listbox); usleep(500000); } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After selecting five options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After selecting five options"); - message(MAIN_STRING "De-selecting options\n"); + message("clistbox_main: De-selecting options\n"); int index; int count = 0; while ((index = listbox->getSelectedIndex()) >= 0) { - message(MAIN_STRING "De-selecting option %d\n", index); + message("clistbox_main: De-selecting option %d\n", index); listbox->deselectOption(index); test->showListBox(listbox); count++; usleep(500000); } - message(MAIN_STRING "%s: %d options de-selected\n", + message("clistbox_main: %s: %d options de-selected\n", count == 5 ? "OK" : "ERROR", count); - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After de-selecting options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After de-selecting options"); - message(MAIN_STRING "Removing the selected options\n"); + message("clistbox_main: Removing the selected options\n"); for (int i = 0; i < 5; i++) { - message(MAIN_STRING "Removing option %d\n", selected[i]); + message("clistbox_main: Removing option %d\n", selected[i]); listbox->removeOption(selected[i]); test->showListBox(listbox); usleep(500000); } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After removing five options"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After removing five options"); } sleep(1); } - updateMemoryUsage(g_mmPrevious, MAIN_STRING "After the listbox is empty again"); + updateMemoryUsage(g_mmPrevious, "clistbox_main: After the listbox is empty again"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("clistbox_main: Clean-up and exit\n"); delete listbox; updateMemoryUsage(g_mmPrevious, "After deleting the listbox"); delete test; diff --git a/NxWidgets/UnitTests/CListBox/clistboxtest.hxx b/NxWidgets/UnitTests/CListBox/clistboxtest.hxx index 88e41f3bf..a19a2fabc 100644 --- a/NxWidgets/UnitTests/CListBox/clistboxtest.hxx +++ b/NxWidgets/UnitTests/CListBox/clistboxtest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CLISTBOXTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME clistbox_main -# define MAIN_STRING "clistbox_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CProgressBar/Makefile b/NxWidgets/UnitTests/CProgressBar/Makefile index a1e09ed57..5ee346b52 100644 --- a/NxWidgets/UnitTests/CProgressBar/Makefile +++ b/NxWidgets/UnitTests/CProgressBar/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cprogressbartest.cxx +CXXSRCS = cprogressbar_main.cxx cprogressbartest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CProgressBar/main.cxx b/NxWidgets/UnitTests/CProgressBar/cprogressbar_main.cxx index 525c509d3..cb5fa130e 100644 --- a/NxWidgets/UnitTests/CProgressBar/main.cxx +++ b/NxWidgets/UnitTests/CProgressBar/cprogressbar_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CProgressBar/main.cxx +// NxWidgets/UnitTests/CProgressBar/cprogressbar_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cprogressbar_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cprogressbar_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,43 +143,43 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CProgressBarTest instance\n"); + message("cprogressbar_main: Create CProgressBarTest instance\n"); CProgressBarTest *test = new CProgressBarTest(); updateMemoryUsage(g_mmprevious, "After creating CProgressBarTest"); // Connect the NX server - message(MAIN_STRING "Connect the CProgressBarTest instance to the NX server\n"); + message("cprogressbar_main: Connect the CProgressBarTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CProgressBarTest instance to the NX server\n"); + message("cprogressbar_main: Failed to connect the CProgressBarTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cprogressbar_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cprogressbar_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After creating a window"); // Create a progress bar - message(MAIN_STRING "Create a ProgressBar\n"); + message("cprogressbar_main: Create a ProgressBar\n"); CProgressBar *bar = test->createProgressBar(); if (!bar) { - message(MAIN_STRING "Failed to create a progress bar\n"); + message("cprogressbar_main: Failed to create a progress bar\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a progress bar"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After creating a progress bar"); // Set the progress bar minimum and maximum values @@ -187,7 +187,7 @@ int MAIN_NAME(int argc, char *argv[]) bar->setMaximumValue(MAX_PROGRESSBAR); bar->setValue(0); bar->hidePercentageText(); - message(MAIN_STRING "ProgressBar range %d->%d Initial value %d\n", + message("cprogressbar_main: ProgressBar range %d->%d Initial value %d\n", bar->getMinimumValue(), bar->getMaximumValue(), bar->getValue()); @@ -202,10 +202,10 @@ int MAIN_NAME(int argc, char *argv[]) { bar->setValue(i); test->showProgressBar(bar); - message(MAIN_STRING "%d. New value %d\n", i, bar->getValue()); + message("cprogressbar_main: %d. New value %d\n", i, bar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the progress bar up #1"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After moving the progress bar up #1"); usleep(500*1000); // Now move the progress bar up from 0 to 100% (with percentages off) @@ -219,15 +219,15 @@ int MAIN_NAME(int argc, char *argv[]) { bar->setValue(i); test->showProgressBar(bar); - message(MAIN_STRING "%d. New value %d\n", i, bar->getValue()); + message("cprogressbar_main: %d. New value %d\n", i, bar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the progress bar up #2"); + updateMemoryUsage(g_mmprevious, "cprogressbar_main: After moving the progress bar up #2"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cprogressbar_main: Clean-up and exit\n"); delete bar; updateMemoryUsage(g_mmprevious, "After deleting the progress bar"); delete test; diff --git a/NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx b/NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx index 99312cf8f..a7a4238e7 100644 --- a/NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx +++ b/NxWidgets/UnitTests/CProgressBar/cprogressbartest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CPROGRESSBARTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cprogressbar_main -# define MAIN_STRING "cprogressbar_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CRadioButton/Makefile b/NxWidgets/UnitTests/CRadioButton/Makefile index f861326e9..57190e8d3 100644 --- a/NxWidgets/UnitTests/CRadioButton/Makefile +++ b/NxWidgets/UnitTests/CRadioButton/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cradiobuttontest.cxx +CXXSRCS = cradiobutton_main.cxx cradiobuttontest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CRadioButton/main.cxx b/NxWidgets/UnitTests/CRadioButton/cradiobutton_main.cxx index d53cd4a09..0ec1ca196 100644 --- a/NxWidgets/UnitTests/CRadioButton/main.cxx +++ b/NxWidgets/UnitTests/CRadioButton/cradiobutton_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CRadioButton/main.cxx +// NxWidgets/UnitTests/CRadioButton/cradiobutton_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cradiobutton_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cradiobutton_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,60 +143,60 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the radio button test - message(MAIN_STRING "Create CRadioButtonTest instance\n"); + message("cradiobutton_main: Create CRadioButtonTest instance\n"); CRadioButtonTest *test = new CRadioButtonTest(); updateMemoryUsage(g_mmprevious, "After creating CRadioButtonTest"); // Connect the NX server - message(MAIN_STRING "Connect the CRadioButtonTest instance to the NX server\n"); + message("cradiobutton_main: Connect the CRadioButtonTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CRadioButtonTest instance to the NX server\n"); + message("cradiobutton_main: Failed to connect the CRadioButtonTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cradiobutton_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cradiobutton_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After creating a window"); // Create three radio buttons CRadioButton *button1 = test->newRadioButton(); if (!button1) { - message(MAIN_STRING "Failed to create radio button 1\n"); + message("cradiobutton_main: Failed to create radio button 1\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 1"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After creating radio button 1"); CRadioButton *button2 = test->newRadioButton(); if (!button2) { - message(MAIN_STRING "Failed to create radio button 2\n"); + message("cradiobutton_main: Failed to create radio button 2\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 2"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After creating radio button 2"); CRadioButton *button3 = test->newRadioButton(); if (!button3) { - message(MAIN_STRING "Failed to create radio button 3\n"); + message("cradiobutton_main: Failed to create radio button 3\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating radio button 3"); + updateMemoryUsage(g_mmprevious, "cradiobutton_main: After creating radio button 3"); // Show the initial state of the buttons @@ -206,21 +206,21 @@ int MAIN_NAME(int argc, char *argv[]) // Now push some buttons - message(MAIN_STRING "Pushing button 1\n"); + message("cradiobutton_main: Pushing button 1\n"); test->pushButton(button1); usleep(500*1000); test->showButtonState(); updateMemoryUsage(g_mmprevious, "After pushing button 1"); usleep(500*1000); - message(MAIN_STRING "Pushing button 2\n"); + message("cradiobutton_main: Pushing button 2\n"); test->pushButton(button2); usleep(500*1000); test->showButtonState(); updateMemoryUsage(g_mmprevious, "After pushing button 2"); usleep(500*1000); - message(MAIN_STRING "Pushing button 3\n"); + message("cradiobutton_main: Pushing button 3\n"); test->pushButton(button3); usleep(500*1000); test->showButtonState(); @@ -229,7 +229,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cradiobutton_main: Clean-up and exit\n"); delete test; updateMemoryUsage(g_mmprevious, "After deleting the test"); updateMemoryUsage(g_mmInitial, "Final memory usage"); diff --git a/NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx b/NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx index 00cded78c..540d5019b 100644 --- a/NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx +++ b/NxWidgets/UnitTests/CRadioButton/cradiobuttontest.hxx @@ -70,16 +70,6 @@ # define CONFIG_CRADIOBUTTONTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cradiobutton_main -# define MAIN_STRING "cradiobutton_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CScrollbarHorizontal/Makefile b/NxWidgets/UnitTests/CScrollbarHorizontal/Makefile index a6abb461b..191324a96 100644 --- a/NxWidgets/UnitTests/CScrollbarHorizontal/Makefile +++ b/NxWidgets/UnitTests/CScrollbarHorizontal/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cscrollbarhorizontaltest.cxx +CXXSRCS = cscrollbarhorizontal_main.cxx cscrollbarhorizontaltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx b/NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx index fac165033..774225091 100644 --- a/NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx +++ b/NxWidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CSCROLLBARHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cscrollbarhorizontal_main -# define MAIN_STRING "cscrollbarhorizontal_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CScrollbarVertical/Makefile b/NxWidgets/UnitTests/CScrollbarVertical/Makefile index ad7ae2a38..a2777e752 100644 --- a/NxWidgets/UnitTests/CScrollbarVertical/Makefile +++ b/NxWidgets/UnitTests/CScrollbarVertical/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx cscrollbarverticaltest.cxx +CXXSRCS = cscrollbarvertical_main.cxx cscrollbarverticaltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CScrollbarVertical/main.cxx b/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx index 16bd9eea6..26dc70dbd 100644 --- a/NxWidgets/UnitTests/CScrollbarVertical/main.cxx +++ b/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CScrollbarVertical/main.cxx +// NxWidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cscrollbarvertical_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cscrollbarvertical_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,50 +143,50 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CScrollbarVerticalTest instance\n"); + message("cscrollbarvertical_main: Create CScrollbarVerticalTest instance\n"); CScrollbarVerticalTest *test = new CScrollbarVerticalTest(); updateMemoryUsage(g_mmprevious, "After creating CScrollbarVerticalTest"); // Connect the NX server - message(MAIN_STRING "Connect the CScrollbarVerticalTest instance to the NX server\n"); + message("cscrollbarvertical_main: Connect the CScrollbarVerticalTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CScrollbarVerticalTest instance to the NX server\n"); + message("cscrollbarvertical_main: Failed to connect the CScrollbarVerticalTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cscrollbarvertical_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cscrollbarvertical_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After creating a window"); // Create a scrollbar - message(MAIN_STRING "Create a Scrollbar\n"); + message("cscrollbarvertical_main: Create a Scrollbar\n"); CScrollbarVertical *scrollbar = test->createScrollbar(); if (!scrollbar) { - message(MAIN_STRING "Failed to create a scrollbar\n"); + message("cscrollbarvertical_main: Failed to create a scrollbar\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a scrollbar"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After creating a scrollbar"); // Set the scrollbar minimum and maximum values scrollbar->setMinimumValue(0); scrollbar->setMaximumValue(MAX_SCROLLBAR); scrollbar->setValue(0); - message(MAIN_STRING "Scrollbar range %d->%d Initial value %d\n", + message("cscrollbarvertical_main: Scrollbar range %d->%d Initial value %d\n", scrollbar->getMinimumValue(), scrollbar->getMaximumValue(), scrollbar->getValue()); @@ -201,10 +201,10 @@ int MAIN_NAME(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + message("cscrollbarvertical_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar up"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After moving the scrollbar up"); // And move the scrollbar down @@ -212,15 +212,15 @@ int MAIN_NAME(int argc, char *argv[]) { scrollbar->setValue(i); test->showScrollbar(scrollbar); - message(MAIN_STRING "%d. New value %d\n", i, scrollbar->getValue()); + message("cscrollbarvertical_main: %d. New value %d\n", i, scrollbar->getValue()); usleep(5000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the scrollbar down"); + updateMemoryUsage(g_mmprevious, "cscrollbarvertical_main: After moving the scrollbar down"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cscrollbarvertical_main: Clean-up and exit\n"); delete scrollbar; updateMemoryUsage(g_mmprevious, "After deleting the scrollbar"); delete test; diff --git a/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx b/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx index e6005ced9..8b9fb1ee8 100644 --- a/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx +++ b/NxWidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CSCROLLBARVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cscrollbarvertical_main -# define MAIN_STRING "cscrollbarvertical_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CSliderHorizonal/Makefile b/NxWidgets/UnitTests/CSliderHorizonal/Makefile index 0a86aaf5f..0578510d3 100644 --- a/NxWidgets/UnitTests/CSliderHorizonal/Makefile +++ b/NxWidgets/UnitTests/CSliderHorizonal/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx csliderhorizontaltest.cxx +CXXSRCS = csliderhorizontal_main.cxx csliderhorizontaltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CSliderHorizonal/main.cxx b/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx index b99d1c547..a336ba94a 100644 --- a/NxWidgets/UnitTests/CSliderHorizonal/main.cxx +++ b/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CSliderHorizontal/main.cxx +// NxWidgets/UnitTests/CSliderHorizontal/csliderhorizontal_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int csliderhorizontal_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int csliderhorizontal_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,50 +143,50 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CSliderHorizontalTest instance\n"); + message("csliderhorizontal_main: Create CSliderHorizontalTest instance\n"); CSliderHorizontalTest *test = new CSliderHorizontalTest(); updateMemoryUsage(g_mmprevious, "After creating CSliderHorizontalTest"); // Connect the NX server - message(MAIN_STRING "Connect the CSliderHorizontalTest instance to the NX server\n"); + message("csliderhorizontal_main: Connect the CSliderHorizontalTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CSliderHorizontalTest instance to the NX server\n"); + message("csliderhorizontal_main: Failed to connect the CSliderHorizontalTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("csliderhorizontal_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("csliderhorizontal_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After creating a window"); // Create a slider - message(MAIN_STRING "Create a Slider\n"); + message("csliderhorizontal_main: Create a Slider\n"); CSliderHorizontal *slider = test->createSlider(); if (!slider) { - message(MAIN_STRING "Failed to create a slider\n"); + message("csliderhorizontal_main: Failed to create a slider\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a slider"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After creating a slider"); // Set the slider minimum and maximum values slider->setMinimumValue(0); slider->setMaximumValue(MAX_SLIDER); slider->setValue(0); - message(MAIN_STRING "Slider range %d->%d Initial value %d\n", + message("csliderhorizontal_main: Slider range %d->%d Initial value %d\n", slider->getMinimumValue(), slider->getMaximumValue(), slider->getValue()); @@ -201,10 +201,10 @@ int MAIN_NAME(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider up"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider up"); // And move the slider down @@ -212,15 +212,15 @@ int MAIN_NAME(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + message("csliderhorizontal_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider down"); + updateMemoryUsage(g_mmprevious, "csliderhorizontal_main: After moving the slider down"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("csliderhorizontal_main: Clean-up and exit\n"); delete slider; updateMemoryUsage(g_mmprevious, "After deleting the slider"); delete test; diff --git a/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx b/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx index 99d6f739e..9709a2b7c 100644 --- a/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx +++ b/NxWidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CSLIDERHORIZONTALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME csliderhorizontal_main -# define MAIN_STRING "csliderhorizontal_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CSliderVertical/Makefile b/NxWidgets/UnitTests/CSliderVertical/Makefile index 76fd0da57..f37cc8619 100644 --- a/NxWidgets/UnitTests/CSliderVertical/Makefile +++ b/NxWidgets/UnitTests/CSliderVertical/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx csliderverticaltest.cxx +CXXSRCS = cslidervertical_main.cxx csliderverticaltest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CSliderVertical/main.cxx b/NxWidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx index f5a53f018..df356718b 100644 --- a/NxWidgets/UnitTests/CSliderVertical/main.cxx +++ b/NxWidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CSliderVertical/main.cxx +// NxWidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -73,7 +73,7 @@ static unsigned int g_mmprevious; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int cslidervertical_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Private Functions @@ -135,7 +135,7 @@ static void initMemoryUsage(void) // Name: user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int cslidervertical_main(int argc, char *argv[]) { // Initialize memory monitor logic @@ -143,50 +143,50 @@ int MAIN_NAME(int argc, char *argv[]) // Create an instance of the checkbox test - message(MAIN_STRING "Create CSliderVerticalTest instance\n"); + message("cslidervertical_main: Create CSliderVerticalTest instance\n"); CSliderVerticalTest *test = new CSliderVerticalTest(); updateMemoryUsage(g_mmprevious, "After creating CSliderVerticalTest"); // Connect the NX server - message(MAIN_STRING "Connect the CSliderVerticalTest instance to the NX server\n"); + message("cslidervertical_main: Connect the CSliderVerticalTest instance to the NX server\n"); if (!test->connect()) { - message(MAIN_STRING "Failed to connect the CSliderVerticalTest instance to the NX server\n"); + message("cslidervertical_main: Failed to connect the CSliderVerticalTest instance to the NX server\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After connecting to the server"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After connecting to the server"); // Create a window to draw into - message(MAIN_STRING "Create a Window\n"); + message("cslidervertical_main: Create a Window\n"); if (!test->createWindow()) { - message(MAIN_STRING "Failed to create a window\n"); + message("cslidervertical_main: Failed to create a window\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a window"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After creating a window"); // Create a slider - message(MAIN_STRING "Create a Slider\n"); + message("cslidervertical_main: Create a Slider\n"); CSliderVertical *slider = test->createSlider(); if (!slider) { - message(MAIN_STRING "Failed to create a slider\n"); + message("cslidervertical_main: Failed to create a slider\n"); delete test; return 1; } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After creating a slider"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After creating a slider"); // Set the slider minimum and maximum values slider->setMinimumValue(0); slider->setMaximumValue(MAX_SLIDER); slider->setValue(0); - message(MAIN_STRING "Slider range %d->%d Initial value %d\n", + message("cslidervertical_main: Slider range %d->%d Initial value %d\n", slider->getMinimumValue(), slider->getMaximumValue(), slider->getValue()); @@ -201,10 +201,10 @@ int MAIN_NAME(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + message("cslidervertical_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider up"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After moving the slider up"); // And move the slider down @@ -212,15 +212,15 @@ int MAIN_NAME(int argc, char *argv[]) { slider->setValue(i); test->showSlider(slider); - message(MAIN_STRING "%d. New value %d\n", i, slider->getValue()); + message("cslidervertical_main: %d. New value %d\n", i, slider->getValue()); usleep(1000); // The simulation needs this to let the X11 event loop run } - updateMemoryUsage(g_mmprevious, MAIN_STRING "After moving the slider down"); + updateMemoryUsage(g_mmprevious, "cslidervertical_main: After moving the slider down"); sleep(1); // Clean up and exit - message(MAIN_STRING "Clean-up and exit\n"); + message("cslidervertical_main: Clean-up and exit\n"); delete slider; updateMemoryUsage(g_mmprevious, "After deleting the slider"); delete test; diff --git a/NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx b/NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx index a0d3df801..3bb174ba0 100644 --- a/NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx +++ b/NxWidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx @@ -69,16 +69,6 @@ # define CONFIG_CSLIDERVERTICALTEST_BGCOLOR CONFIG_NXWIDGETS_DEFAULT_BACKGROUNDCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME cslidervertical_main -# define MAIN_STRING "cslidervertical_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - // If debug is enabled, use the debug function, lib_rawprintf() instead // of printf() so that the output is synchronized. diff --git a/NxWidgets/UnitTests/CTextBox/Makefile b/NxWidgets/UnitTests/CTextBox/Makefile index bd7d98491..c368cc497 100644 --- a/NxWidgets/UnitTests/CTextBox/Makefile +++ b/NxWidgets/UnitTests/CTextBox/Makefile @@ -63,7 +63,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx ctextboxtest.cxx +CXXSRCS = ctextbox_main.cxx ctextboxtest.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/CTextBox/main.cxx b/NxWidgets/UnitTests/CTextBox/ctextbox_main.cxx index b5b8ec4d5..da76c88cf 100644 --- a/NxWidgets/UnitTests/CTextBox/main.cxx +++ b/NxWidgets/UnitTests/CTextBox/ctextbox_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/CTextBox/main.cxx +// NxWidgets/UnitTests/CTextBox/ctextbox_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -69,7 +69,7 @@ static const char string2[] = "\b\b\bn Doe\r"; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int ctextbox_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Public Functions @@ -79,29 +79,29 @@ extern "C" int MAIN_NAME(int argc, char *argv[]); // user_start/nxheaders_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int ctextbox_main(int argc, char *argv[]) { // Create an instance of the font test - printf(MAIN_STRING "Create CTextBoxTest instance\n"); + printf("ctextbox_main: Create CTextBoxTest instance\n"); CTextBoxTest *test = new CTextBoxTest(); // Connect the NX server - printf(MAIN_STRING "Connect the CTextBoxTest instance to the NX server\n"); + printf("ctextbox_main: Connect the CTextBoxTest instance to the NX server\n"); if (!test->connect()) { - printf(MAIN_STRING "Failed to connect the CTextBoxTest instance to the NX server\n"); + printf("ctextbox_main: Failed to connect the CTextBoxTest instance to the NX server\n"); delete test; return 1; } // Create a window to draw into - printf(MAIN_STRING "Create a Window\n"); + printf("ctextbox_main: Create a Window\n"); if (!test->createWindow()) { - printf(MAIN_STRING "Failed to create a window\n"); + printf("ctextbox_main: Failed to create a window\n"); delete test; return 1; } @@ -111,7 +111,7 @@ int MAIN_NAME(int argc, char *argv[]) CTextBox *textbox = test->createTextBox(); if (!textbox) { - printf(MAIN_STRING "Failed to create a text box\n"); + printf("ctextbox_main: Failed to create a text box\n"); delete test; return 1; } @@ -133,7 +133,7 @@ int MAIN_NAME(int argc, char *argv[]) // Clean up and exit sleep(2); - printf(MAIN_STRING "Clean-up and exit\n"); + printf("ctextbox_main: Clean-up and exit\n"); delete textbox; delete test; return 0; diff --git a/NxWidgets/UnitTests/CTextBox/ctextboxtest.hxx b/NxWidgets/UnitTests/CTextBox/ctextboxtest.hxx index 1d470a1a8..9da8ce09f 100644 --- a/NxWidgets/UnitTests/CTextBox/ctextboxtest.hxx +++ b/NxWidgets/UnitTests/CTextBox/ctextboxtest.hxx @@ -75,16 +75,6 @@ # define CONFIG_CTEXTBOXTEST_FONTCOLOR CONFIG_NXWIDGETS_DEFAULT_FONTCOLOR #endif -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME ctextbox_main -# define MAIN_STRING "ctextbox_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - ///////////////////////////////////////////////////////////////////////////// // Public Classes ///////////////////////////////////////////////////////////////////////////// diff --git a/NxWidgets/UnitTests/nxwm/Makefile b/NxWidgets/UnitTests/nxwm/Makefile index 9648ad807..11c670ece 100644 --- a/NxWidgets/UnitTests/nxwm/Makefile +++ b/NxWidgets/UnitTests/nxwm/Makefile @@ -77,7 +77,7 @@ ARCHIVER=$(TESTTOOL_DIR)/addobjs.sh ASRCS = CSRCS = -CXXSRCS = main.cxx +CXXSRCS = nxwm_main.cxx AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/NxWidgets/UnitTests/nxwm/main.cxx b/NxWidgets/UnitTests/nxwm/nxwm_main.cxx index f61252904..eefc44494 100644 --- a/NxWidgets/UnitTests/nxwm/main.cxx +++ b/NxWidgets/UnitTests/nxwm/nxwm_main.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// NxWidgets/UnitTests/nxwm/main.cxx +// NxWidgets/UnitTests/nxwm/nxwm_main.cxx // // Copyright (C) 2012 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> @@ -62,16 +62,6 @@ // Pre-processor Definitions ///////////////////////////////////////////////////////////////////////////// -// What is the entry point called? - -#ifdef CONFIG_NSH_BUILTIN_APPS -# define MAIN_NAME nxwm_main -# define MAIN_STRING "nxwm_main: " -#else -# define MAIN_NAME user_start -# define MAIN_STRING "user_start: " -#endif - #ifdef CONFIG_HAVE_FILENAME # define showTestStepMemory(msg) \ _showTestStepMemory((FAR const char*)__FILE__, (int)__LINE__, msg) @@ -121,7 +111,7 @@ static struct SNxWmTest g_nxwmtest; // Suppress name-mangling -extern "C" int MAIN_NAME(int argc, char *argv[]); +extern "C" int nxwm_main(int argc, char *argv[]); ///////////////////////////////////////////////////////////////////////////// // Public Functions @@ -503,7 +493,7 @@ static bool createCalibration(void) printf("createCalibration: Start the calibration application\n"); if (!g_nxwmtest.taskbar->startApplication(calibration, false)) { - printf(MAIN_STRING "ERROR: Failed to start the calibration application\n"); + printf("createCalibration ERROR: Failed to start the calibration application\n"); delete calibration; return false; } @@ -599,7 +589,7 @@ void showTestStepMemory(FAR const char *msg) // user_start/nxwm_main ///////////////////////////////////////////////////////////////////////////// -int MAIN_NAME(int argc, char *argv[]) +int nxwm_main(int argc, char *argv[]) { // Call all C++ static constructors @@ -613,19 +603,19 @@ int MAIN_NAME(int argc, char *argv[]) // Initialize the NSH library - printf(MAIN_STRING "Initialize the NSH library\n"); + printf("nxwm_main: Initialize the NSH library\n"); if (!NxWM::nshlibInitialize()) { - printf(MAIN_STRING "ERROR: Failed to initialize the NSH library\n"); + printf("nxwm_main: ERROR: Failed to initialize the NSH library\n"); return EXIT_FAILURE; } - showTestCaseMemory(MAIN_STRING "After initializing the NSH library"); + showTestCaseMemory("nxwm_main: After initializing the NSH library"); // Create the task bar. if (!createTaskbar()) { - printf(MAIN_STRING "ERROR: Failed to create the task bar\n"); + printf("nxwm_main: ERROR: Failed to create the task bar\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -633,7 +623,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createStartWindow()) { - printf(MAIN_STRING "ERROR: Failed to create the start window\n"); + printf("nxwm_main: ERROR: Failed to create the start window\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -642,7 +632,7 @@ int MAIN_NAME(int argc, char *argv[]) #ifdef CONFIG_NXWM_KEYBOARD if (!createKeyboard()) { - printf(MAIN_STRING "ERROR: Failed to create the keyboard\n"); + printf("nxwm_main: ERROR: Failed to create the keyboard\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif @@ -652,7 +642,7 @@ int MAIN_NAME(int argc, char *argv[]) #ifdef CONFIG_NXWM_TOUCHSCREEN if (!createTouchScreen()) { - printf(MAIN_STRING "ERROR: Failed to create the touchscreen\n"); + printf("nxwm_main ERROR: Failed to create the touchscreen\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif @@ -662,7 +652,7 @@ int MAIN_NAME(int argc, char *argv[]) #ifdef CONFIG_NXWM_TOUCHSCREEN if (!createCalibration()) { - printf(MAIN_STRING "ERROR: Failed to create the calibration application\n"); + printf("nxwm_main ERROR: Failed to create the calibration application\n"); testCleanUpAndExit(EXIT_FAILURE); } #endif @@ -671,7 +661,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createNxConsole()) { - printf(MAIN_STRING "ERROR: Failed to create the NxConsole application\n"); + printf("nxwm_main: ERROR: Failed to create the NxConsole application\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -679,7 +669,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!createHexCalculator()) { - printf(MAIN_STRING "ERROR: Failed to create the hex calculator application\n"); + printf("nxwm_main: ERROR: Failed to create the hex calculator application\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -687,7 +677,7 @@ int MAIN_NAME(int argc, char *argv[]) if (!startWindowManager()) { - printf(MAIN_STRING "ERROR: Failed to start the window manager\n"); + printf("nxwm_main: ERROR: Failed to start the window manager\n"); testCleanUpAndExit(EXIT_FAILURE); } @@ -697,7 +687,7 @@ int MAIN_NAME(int argc, char *argv[]) // to know whenthe touchscreen has been calibrated. If we really want to know, // we have to poll - printf(MAIN_STRING "Waiting for touchscreen calibration\n"); + printf("nxwm_main: Waiting for touchscreen calibration\n"); while (!g_nxwmtest.touchscreen->isCalibrated()) { std::sleep(2); @@ -708,10 +698,10 @@ int MAIN_NAME(int argc, char *argv[]) // After the touchscreen driver gets it, it will report isCalibrated() == true // and then we can read the calibration data from the touchscreen driver. - printf(MAIN_STRING "Getting calibration data from the touchscreen\n"); + printf("nxwm_main: Getting calibration data from the touchscreen\n"); if (!g_nxwmtest.touchscreen->getCalibrationData(g_nxwmtest.calibData)) { - printf(MAIN_STRING "ERROR: Failed to get calibration data from the touchscreen\n"); + printf("nxwm_main: ERROR: Failed to get calibration data from the touchscreen\n"); } #endif @@ -723,7 +713,7 @@ int MAIN_NAME(int argc, char *argv[]) g_nxwmtest.taskbar->clickIcon(0, true); usleep(500*1000); g_nxwmtest.taskbar->clickIcon(0, false); - showTestCaseMemory(MAIN_STRING "After clicking the start window icon"); + showTestCaseMemory("nxwm_main: After clicking the start window icon"); // Wait bit to see the result of the button press. Then press the first icon // in the start menu. That should be the NxConsole icon. @@ -732,13 +722,13 @@ int MAIN_NAME(int argc, char *argv[]) g_nxwmtest.startwindow->clickIcon(0, true); usleep(500*1000); g_nxwmtest.startwindow->clickIcon(0, false); - showTestCaseMemory(MAIN_STRING "After clicking the NxConsole icon"); + showTestCaseMemory("nxwm_main: After clicking the NxConsole icon"); #endif // Wait bit to see the result of the button press. sleep(2); - showTestMemory(MAIN_STRING "Final memory usage"); + showTestMemory("nxwm_main: Final memory usage"); return EXIT_SUCCESS; } |