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 | |
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.
-rw-r--r-- | ChangeLog-98a | 12 | ||||
-rw-r--r-- | ace/Env_Value_T.cpp | 2 | ||||
-rw-r--r-- | ace/Env_Value_T.h | 2 | ||||
-rw-r--r-- | ace/Env_Value_T.i | 9 | ||||
-rw-r--r-- | tests/Env_Value_Test.cpp | 27 |
5 files changed, 28 insertions, 24 deletions
diff --git a/ChangeLog-98a b/ChangeLog-98a index 795f6488104..0262b9a456f 100644 --- a/ChangeLog-98a +++ b/ChangeLog-98a @@ -1,3 +1,15 @@ +Fri Jan 2 10:23:05 1998 Chris Cleeland <cleeland@cs.wustl.edu> + + * 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. + + * ace/Env_Value_T.*: Fixed lots of little bugs that got past both + g++ and Solaris compilers, but were caught by the ever-skeptical + SGI compiler. This included providing a definition for the missing + 'varname(void)' method. + Fri Jan 02 10:12:28 1998 Steve Huston <shuston@riverace.com> * ace/config-hpux-10.x-g++.h: Added #define HPUX_10 to catch OS diff --git a/ace/Env_Value_T.cpp b/ace/Env_Value_T.cpp index 758f3203137..6e8410d968f 100644 --- a/ace/Env_Value_T.cpp +++ b/ace/Env_Value_T.cpp @@ -5,8 +5,6 @@ #endif /* __ACE_INLINE__ */ #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template void ACE_Convert(const char*, char*&); #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate void ACE_Convert (const char*, char*&) #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/ace/Env_Value_T.h b/ace/Env_Value_T.h index 5a2b88ea434..7af97e76b59 100644 --- a/ace/Env_Value_T.h +++ b/ace/Env_Value_T.h @@ -43,7 +43,7 @@ public: ~ACE_Env_Value (void); // Destroy the value. - operator const T (void) const; + operator T (void); // Returns the value as type T. void open (const char *varname, const T &defval); diff --git a/ace/Env_Value_T.i b/ace/Env_Value_T.i index 31828bfe385..397a5614e0f 100644 --- a/ace/Env_Value_T.i +++ b/ace/Env_Value_T.i @@ -1,7 +1,7 @@ // $Id$ template <class T> ACE_INLINE -ACE_Env_Value<T>::operator const T (void) const +ACE_Env_Value<T>::operator T (void) { return value_; } @@ -21,7 +21,6 @@ ACE_Env_Value<T>::ACE_Env_Value (const char *varname, this->fetch_value (); } - template <class T> ACE_INLINE void ACE_Env_Value<T>::open (const char *varname, const T &defval) @@ -40,6 +39,12 @@ ACE_Env_Value<T>::fetch_value (void) ACE_Convert (env, value_); } +template <class T> ACE_INLINE const char* +ACE_Env_Value<T>::varname (void) const +{ + return varname_; +} + template <class T> ACE_INLINE ACE_Env_Value<T>::~ACE_Env_Value (void) { 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; } |