JavaQxNUnit.h

00001 /*
00002  * @(#)JavaQxNUnit.h  0.2.0 / 2007-12-30
00003  *
00004  * Copyright (c) 2007, ETF and contributors. All rights reserved.
00005  *
00006  * This software is licensed under the LGPL, version 2.1, license.
00007  * A copy of the license is included in the file LICENSE-LGPL.txt.
00008  */
00009 #ifndef JAVAQXNUNIT_H
00010 #define JAVAQXNUNIT_H
00011 
00012 #ifdef JAVAQX_TEST
00013 
00021 /*^**************************************************************************^*/
00022 /*- JavaQxNUnit :: Includes.                                                 -*/
00023 /*^**************************************************************************^*/
00024 
00025 #include "NativeTestRegistry.h"
00026 #include "NativeTestCase.h"
00027 
00028 /*^**************************************************************************^*/
00029 /*- Macro Definitions.                                                       -*/
00030 /*^**************************************************************************^*/
00031 
00032 #define TEST_ASSERT(condition) \
00033     do { \
00034       if (!(condition)) { \
00035         failCondition(#condition, __FILE__, __LINE__); \
00036         return; \
00037       } \
00038     } while (false)
00039 #define TEST_ASSERT_EQUALS(obj1, obj2) \
00040     do { \
00041       if (!(obj1 == obj2)) { \
00042         failCondition(#obj1" == "#obj2, __FILE__, __LINE__); \
00043         return; \
00044       } \
00045     } while (false)
00046 
00047 #define REGISTER_NATIVE_TEST(module, class) \
00048     static bool registred = NativeTestRegistry:: \
00049               registerTestFactory(#module, new NativeTestFactory<class>(#class))
00050 
00051 #endif // JAVAQX_TEST
00052 
00053 #endif // JAVAQXNUNIT_H
00054 
00055 /*^*****************************************************************************
00056   File History:
00057 
00058  - 2007-12-30 12:53:13 Slobodan
00059    Initial version
00060 
00061 *****************************************************************************^*/

Copyright © 2007 ETF and contributors. All Rights Reserved.