ICE 3.4.2
[php5-ice-freebsdport.git] / cpp / test / include / TestCommon.h
blob651a885524c6cc94123794128f8874a65605b970
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
10 #ifndef TEST_COMMON_H
11 #define TEST_COMMON_H
13 #include <IceUtil/Config.h>
14 #include <cstdlib>
16 #ifdef __BCPLUSPLUS__
17 #include <stdlib.h>
18 #endif
20 void
21 inline testFailed(const char* expr, const char* file, unsigned int line)
23 std::cout << "failed!" << std::endl;
24 std::cout << file << ':' << line << ": assertion `" << expr << "' failed" << std::endl;
25 abort();
28 #define test(ex) ((ex) ? ((void)0) : testFailed(#ex, __FILE__, __LINE__))
30 #endif