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/UnitTests/CLatchButton | |
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/UnitTests/CLatchButton')
-rw-r--r-- | NxWidgets/UnitTests/CLatchButton/Makefile | 2 | ||||
-rw-r--r-- | NxWidgets/UnitTests/CLatchButton/clatchbutton_main.cxx (renamed from NxWidgets/UnitTests/CLatchButton/main.cxx) | 30 | ||||
-rw-r--r-- | NxWidgets/UnitTests/CLatchButton/clatchbuttontest.hxx | 10 |
3 files changed, 16 insertions, 26 deletions
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 ///////////////////////////////////////////////////////////////////////////// |