1 // Copyright 2009 The RE2 Authors. All Rights Reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 #ifndef RE2_UTIL_TEST_H__
6 #define RE2_UTIL_TEST_H__
9 #include "util/flags.h"
13 TestRegisterer r##x##y(x##y, # x "." # y); \
16 void RegisterTest(void (*)(void), const char*);
18 class TestRegisterer
{
20 TestRegisterer(void (*fn
)(void), const char *s
) {
25 // TODO(rsc): Do a better job.
26 #define EXPECT_EQ CHECK_EQ
27 #define EXPECT_TRUE CHECK
28 #define EXPECT_LT CHECK_LT
29 #define EXPECT_GT CHECK_GT
30 #define EXPECT_LE CHECK_LE
31 #define EXPECT_GE CHECK_GE
32 #define EXPECT_FALSE(x) CHECK(!(x))
34 #define ARRAYSIZE arraysize
36 #define EXPECT_TRUE_M(x, y) CHECK(x) << (y)
37 #define EXPECT_FALSE_M(x, y) CHECK(!(x)) << (y)
38 #define ASSERT_TRUE_M(x, y) CHECK(x) << (y)
39 #define ASSERT_EQUALS(x, y) CHECK_EQ(x, y)
41 const bool UsingMallocCounter
= false;
45 MallocCounter(int x
) { }
46 static const int THIS_THREAD_ONLY
= 0;
47 long long HeapGrowth() { return 0; }
48 long long PeakHeapGrowth() { return 0; }
51 } // namespace testing
54 int64
VirtualProcessSize();
57 #endif // RE2_UTIL_TEST_H__