diff options
Diffstat (limited to 'cppe/test/include/TestCommon.h')
-rw-r--r-- | cppe/test/include/TestCommon.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cppe/test/include/TestCommon.h b/cppe/test/include/TestCommon.h new file mode 100644 index 00000000000..9786b1dc121 --- /dev/null +++ b/cppe/test/include/TestCommon.h @@ -0,0 +1,26 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef TEST_COMMON_H +#define TEST_COMMON_H + +#include <IceUtil/Config.h> +#include <cstdlib> + +void +inline testFailed(const char* expr, const char* file, unsigned int line) +{ + std::cout << "failed!" << std::endl; + std::cout << file << ':' << line << ": assertion `" << expr << "' failed" << std::endl; + abort(); +} + +#define test(ex) ((ex) ? ((void)0) : testFailed(#ex, __FILE__, __LINE__)) + +#endif |