mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 04:43:34 +08:00
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:
@@ -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))
|
||||
|
||||
+16
-16
@@ -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;
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user