IMP logo
IMP Reference Guide  2.20.2
The Integrative Modeling Platform
test_macros.h File Reference

Macros for writing C++ tests. More...

#include <IMP/log_macros.h>
+ Include dependency graph for test_macros.h:

Go to the source code of this file.

Macros

#define IMP_TEST_EQUAL(a, b)
 Report an error if a != b. More...
 
#define IMP_TEST_GREATER_THAN(a, b)
 Report an error if a < b. More...
 
#define IMP_TEST_LESS_THAN(a, b)
 Report an error if a >= b. More...
 
#define IMP_TEST_TRUE(a)
 Report an error if !a. More...
 

Detailed Description

Macros for writing C++ tests.

These should only be used in test code (i.e. C++ binaries in the test/ subdirectory that link against IMP libraries and are run as part of the test suite). For runtime checks of IMP itself, see IMP_INTERNAL_CHECK and IMP_USAGE_CHECK.

Copyright 2007-2022 IMP Inventors. All rights reserved.

Definition in file test_macros.h.

Macro Definition Documentation

#define IMP_TEST_EQUAL (   a,
 
)

Report an error if a != b.

Definition at line 19 of file test_macros.h.

#define IMP_TEST_GREATER_THAN (   a,
 
)

Report an error if a < b.

Definition at line 39 of file test_macros.h.

#define IMP_TEST_LESS_THAN (   a,
 
)

Report an error if a >= b.

Definition at line 32 of file test_macros.h.

#define IMP_TEST_TRUE (   a)
Value:
if (!(a)) { \
IMP_ERROR("Test failed: !" << #a); \
}
#define IMP_ERROR(expr)
Write a warning to standard error.
Definition: log_macros.h:61

Report an error if !a.

Definition at line 26 of file test_macros.h.