This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

CYG_ASSERT_* messages inverted


Am i not understanding something here. If the assertion has failed,
whatever we are checking is invalid, not valid?

         Andrew

Index: packages/infra/current//ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/infra/current/ChangeLog,v
retrieving revision 1.37
diff -u -r1.37 ChangeLog
--- packages/infra/current//ChangeLog	6 May 2003 16:10:02 -0000	1.37
+++ packages/infra/current//ChangeLog	15 May 2003 12:12:38 -0000
@@ -1,3 +1,9 @@
+2003-05-15  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* include/cyg_ass.h: If we see an assertion message, it means the
+	assert has failed. Hence we should be reporting things as invalid,
+	not valid.
+	
 2003-05-05  Gary Thomas  <gary@mlbassoc.com>
 
 	* cdl/infra.cdl: Add option to control number of times tests run.
Index: packages/infra/current//include/cyg_ass.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/infra/current/include/cyg_ass.h,v
retrieving revision 1.11
diff -u -r1.11 cyg_ass.h
--- packages/infra/current//include/cyg_ass.h	18 Jan 2003 04:18:26 -0000	1.11
+++ packages/infra/current//include/cyg_ass.h	15 May 2003 12:12:38 -0000
@@ -176,13 +176,13 @@
 # define CYG_CHECK_DATA_PTRC( _ptr_ )                   \
          CYG_MACRO_START                                \
          if ( !cyg_check_data_ptr((const void *)(_ptr_)))     \
-             CYG_ASSERT_DOCALL("data pointer (" #_ptr_ ") is valid");\
+             CYG_ASSERT_DOCALL("data pointer (" #_ptr_ ") is invalid");\
          CYG_MACRO_END
 
 # define CYG_CHECK_FUNC_PTRC( _ptr_ )                       \
          CYG_MACRO_START                                    \
          if ( !cyg_check_func_ptr((const void (*)(void))(_ptr_))) \
-             CYG_ASSERT_DOCALL("function pointer (" #_ptr_ ") is valid"); \
+             CYG_ASSERT_DOCALL("function pointer (" #_ptr_ ") is invalid"); \
          CYG_MACRO_END
 
 #else // CYGDBG_USE_ASSERTS
@@ -264,17 +264,17 @@
     CYG_ASSERT( this->check_this( CYG_ASSERT_CLASS_ZEAL ), _msg_ )
 
 # define CYG_ASSERT_CLASSC( _pobj_ ) \
-    CYG_ASSERT_CLASS( (_pobj_), "class pointer (" #_pobj_ ") is valid" )
+    CYG_ASSERT_CLASS( (_pobj_), "class pointer (" #_pobj_ ") is invalid" )
 
 # define CYG_ASSERT_CLASSOC( _obj_ ) \
-    CYG_ASSERT_CLASSO( (_obj_), "object (" #_obj_ ") is valid" )
+    CYG_ASSERT_CLASSO( (_obj_), "object (" #_obj_ ") is invalid" )
 
 # define CYG_ASSERT_ZERO_OR_CLASSC( _pobj_ ) \
     CYG_ASSERT_ZERO_OR_CLASS((_pobj_),       \
-        "class pointer (" #_pobj_ ") is zero or valid")
+        "class pointer (" #_pobj_ ") is none-zero and invalid")
 
 # define CYG_ASSERT_THISC( ) \
-    CYG_ASSERT_THIS( "\"this\" pointer is valid" )
+    CYG_ASSERT_THIS( "\"this\" pointer is invalid" )
     
 #define CYGDBG_DEFINE_CHECK_THIS \
     cyg_bool check_this( cyg_assert_class_zeal zeal ) const;
@@ -327,7 +327,7 @@
 
 # define CYG_PRECONDITION_CLASSC( _pobj_ )        \
     CYG_PRECONDITION_CLASS( (_pobj_),             \
-       "precondition, class pointer (" #_pobj_ ") is valid" )
+       "precondition, class pointer (" #_pobj_ ") is invalid" )
     
 # define CYG_POSTCONDITION_CLASS( _pobj_, _msg_ ) \
     CYG_POSTCONDITION( ((0 != (_pobj_)) &&        \
@@ -335,7 +335,7 @@
 
 # define CYG_POSTCONDITION_CLASSC( _pobj_ )       \
     CYG_POSTCONDITION_CLASS( (_pobj_),            \
-       "postcondition, class pointer (" #_pobj_ ") is valid" )
+       "postcondition, class pointer (" #_pobj_ ") is invalid" )
 
 # define CYG_LOOP_INVARIANT_CLASS( _pobj_, _msg_) \
     CYG_LOOP_INVARIANT( ((0 != (_pobj_)) &&       \
@@ -343,7 +343,7 @@
         
 # define CYG_LOOP_INVARIANT_CLASSC( _pobj_ )      \
     CYG_LOOP_INVARIANT_CLASS( (_pobj_),           \
-       "loop invariant, class pointer (" #_pobj_ ") is valid" )
+       "loop invariant, class pointer (" #_pobj_ ") is invalid" )
 
 // All variants of _CLASSO
 # define CYG_PRECONDITION_CLASSO( _obj_, _msg_ )  \
@@ -351,21 +351,21 @@
     
 # define CYG_PRECONDITION_CLASSOC( _obj_ )        \
     CYG_PRECONDITION_CLASSO( (_obj_),             \
-        "precondition, object (" #_obj_ ") is valid" )
+        "precondition, object (" #_obj_ ") is invalid" )
 
 # define CYG_POSTCONDITION_CLASSO( _obj_, _msg_ ) \
     CYG_POSTCONDITION( (_obj_).check_this(CYG_ASSERT_CLASS_ZEAL), _msg_)
     
 # define CYG_POSTCONDITION_CLASSOC( _obj_ )       \
     CYG_POSTCONDITION_CLASSO( (_obj_),            \
-       "postcondition, object (" #_obj_ ") is valid" )
+       "postcondition, object (" #_obj_ ") is invalid" )
                              
 # define CYG_LOOP_INVARIANT_CLASSO( _obj_, _msg_) \
     CYG_LOOP_INVARIANT( (_obj_).check_this(CYG_ASSERT_CLASS_ZEAL), _msg_)
 
 # define CYG_LOOP_INVARIANT_CLASSOC( _obj_ )      \
     CYG_LOOP_INVARIANT_CLASSO( (_obj_),           \
-       "loop invariant, object (" #_obj_ ") is valid" )
+       "loop invariant, object (" #_obj_ ") is invalid" )
 
 // All variants of _ZERO_OR_CLASS
 # define CYG_PRECONDITION_ZERO_OR_CLASS( _pobj_, _msg_ )  \
@@ -374,7 +374,7 @@
     
 # define CYG_PRECONDITION_ZERO_OR_CLASSC( _pobj_ )        \
     CYG_PRECONDITION_ZERO_OR_CLASS( (_pobj_),             \
-       "precondition, class pointer (" #_pobj_ ") is zero or valid" )
+       "precondition, class pointer (" #_pobj_ ") is none-zero and invalid" )
     
 # define CYG_POSTCONDITION_ZERO_OR_CLASS( _pobj_, _msg_ ) \
     CYG_POSTCONDITION( ((0 == (_pobj_)) ||                \
@@ -382,7 +382,7 @@
 
 # define CYG_POSTCONDITION_ZERO_OR_CLASSC( _pobj_ )       \
     CYG_POSTCONDITION_ZERO_OR_CLASS( (_pobj_),            \
-       "postcondition, class pointer (" #_pobj_ ") is zero or valid" )
+       "postcondition, class pointer (" #_pobj_ ") is none-zero and invalid" )
                              
 # define CYG_LOOP_INVARIANT_ZERO_OR_CLASS( _pobj_, _msg_) \
     CYG_LOOP_INVARIANT( ((0 == (_pobj_)) ||               \
@@ -390,26 +390,26 @@
         
 # define CYG_LOOP_INVARIANT_ZERO_OR_CLASSC( _pobj_ )      \
     CYG_LOOP_INVARIANT_ZERO_OR_CLASS( (_pobj_),           \
-       "loop invariant, class pointer (" #_pobj_ ") is zero or valid" )
+       "loop invariant, class pointer (" #_pobj_ ") is none-zero and invalid" )
 
 // All variants of _THIS
 # define CYG_PRECONDITION_THIS( _msg_ )  \
     CYG_PRECONDITION( this->check_this(CYG_ASSERT_CLASS_ZEAL), _msg_)
     
 # define CYG_PRECONDITION_THISC()        \
-    CYG_PRECONDITION_THIS( "precondition, \"this\"  is valid" )
+    CYG_PRECONDITION_THIS( "precondition, \"this\"  is invalid" )
     
 # define CYG_POSTCONDITION_THIS( _msg_ ) \
     CYG_POSTCONDITION( this->check_this(CYG_ASSERT_CLASS_ZEAL), _msg_)
     
 # define CYG_POSTCONDITION_THISC()       \
-    CYG_POSTCONDITION_THIS( "postcondition, \"this\" is valid" )
+    CYG_POSTCONDITION_THIS( "postcondition, \"this\" is invalid" )
                              
 # define CYG_LOOP_INVARIANT_THIS( _msg_) \
     CYG_LOOP_INVARIANT( this->check_this(CYG_ASSERT_CLASS_ZEAL), _msg_)
         
 # define CYG_LOOP_INVARIANT_THISC()      \
-    CYG_LOOP_INVARIANT_THIS( "loop invariant, \"this\" is valid" )
+    CYG_LOOP_INVARIANT_THIS( "loop invariant, \"this\" is invalid" )
 
 #endif // __cplusplus
 
@@ -476,7 +476,7 @@
     }
     ~__CygInvariantObject( ) {
         if ( !rep->check_this( CYG_ASSERT_CLASS_ZEAL ) )
-            CYG_ASSERT_DOCALL( "invariant, object valid on exit" );
+            CYG_ASSERT_DOCALL( "invariant, object invalid on exit" );
         rep = 0;
     };
 };
@@ -507,7 +507,7 @@
 # define CYG_INVARIANT_CLASSC( _type_, _pobj_ )                \
      __CygInvariantObject<_type_>                              \
      __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \
-              ( _pobj_, "invariant, class pointer (" #_pobj_ ") is valid" )
+              ( _pobj_, "invariant, class pointer (" #_pobj_ ") is invalid" )
          
 # define CYG_INVARIANT_CLASSO( _type_, _obj_, _msg_ )          \
      __CygInvariantObject<_type_>                              \
@@ -517,7 +517,7 @@
 # define CYG_INVARIANT_CLASSOC( _type_, _obj_ )                \
      __CygInvariantObject<_type_>                              \
      __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \
-              ( _obj_, "invariant, object (" #_obj_ ") is valid" )
+              ( _obj_, "invariant, object (" #_obj_ ") is invalid" )
 
 # define CYG_INVARIANT_THIS( _type_, _msg_ )                   \
      __CygInvariantObject<_type_>                              \
@@ -527,7 +527,7 @@
 # define CYG_INVARIANT_THISC( _type_ )                         \
      __CygInvariantObject<_type_>                              \
      __CYG_INVARIANT_CLASSNAME( __invariant_class_, __LINE__ ) \
-              ( this, "invariant, \"this\" is valid" )
+              ( this, "invariant, \"this\" is invalid" )
 
 # endif // __cplusplus
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]