diff options
author | Chris Cleeland <chris.cleeland@gmail.com> | 1998-01-02 16:41:16 +0000 |
---|---|---|
committer | Chris Cleeland <chris.cleeland@gmail.com> | 1998-01-02 16:41:16 +0000 |
commit | a070b02ec82bd133c0eccae0637dde108d8fe06e (patch) | |
tree | 639c866cf1c22349a1bba83573a8ca603f0757eb /tests/Env_Value_Test.cpp | |
parent | 6897782bc9d075f52c722cf590ec5918a1988a18 (diff) | |
download | ATCD-a070b02ec82bd133c0eccae0637dde108d8fe06e.tar.gz |
* tests/Env_Value_Test.cpp (main): Changed the definition of the
TEST_THIS macro to be all on one line. While ugly, this helps in
locating the line when ACE_ASSERT fails, since allowing the macro
to have multiple lines skews the line # reported by ACE_ASSERT.
Diffstat (limited to 'tests/Env_Value_Test.cpp')
-rw-r--r-- | tests/Env_Value_Test.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/tests/Env_Value_Test.cpp b/tests/Env_Value_Test.cpp index fd06451d0f3..1754bfcf0e3 100644 --- a/tests/Env_Value_Test.cpp +++ b/tests/Env_Value_Test.cpp @@ -14,26 +14,21 @@ // // ============================================================================ -// main () has three arguments, so we can't use -// ACE_HAS_NONSTATIC_OBJECT_MANAGER. We don't need it, anyways. -#include "ace/inc_user_config.h" -#if defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER) -# undef ACE_HAS_NONSTATIC_OBJECT_MANAGER -#endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER */ - #include "test_config.h" #include "ace/OS.h" #include "ace/Process.h" #include "ace/Env_Value_T.h" int -main (int argc, char *[], char* envp[]) +main (int argc, char *argv[], char* environ[]) { if (argc == 1) { // No arguments means we're the initial test ACE_Process_Options options (1); - options.setenv (envp); + options.setenv (environ); + + char* const* envargv; options.command_line ("Env_Value_Test run_as_test"); @@ -47,16 +42,10 @@ main (int argc, char *[], char* envp[]) else { // In this case we're the child - ACE_START_TEST ("Env_Value_Test"); - -#define TEST_THIS(type,varname,defval,expval) \ - do { \ - ACE_Env_Value<type> val(varname, (defval));\ - ACE_ASSERT (val == (expval)); \ - } while (0) - - ; + ACE_START_TEST ("Env_Value"); +#define TEST_THIS(type,varname,defval,expval) do { ACE_Env_Value<type> val(varname, (defval)); ACE_ASSERT (val == (expval)); } while (0) + TEST_THIS (int, "TEST_VALUE_POSITIVE", 4, 10); TEST_THIS (double, "TEST_VALUE_POSITIVE", -1.0, 10.2); TEST_THIS (unsigned long, "TEST_VALUE_POSITIVE", 0, 10); @@ -73,7 +62,7 @@ main (int argc, char *[], char* envp[]) ACE_END_TEST; } - + return 0; } |