Update all unit tests to conform to recent naming convention changes in NuttX

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5151 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-09-14 15:23:54 +00:00
parent cc0c42dd31
commit 857d2a770b
56 changed files with 311 additions and 487 deletions
+1 -1
View File
@@ -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))
@@ -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;
@@ -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.