grpc
third_party
re2
util
re2/util/test.h
Go to the documentation of this file.
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.
4
5
#ifndef UTIL_TEST_H_
6
#define UTIL_TEST_H_
7
8
#include "util/util.h"
9
#include "util/logging.h"
10
11
namespace
testing
{
12
std::string
TempDir
();
13
}
// namespace testing
14
15
#define TEST(x, y) \
16
void x##y(void); \
17
TestRegisterer r##x##y(x##y, # x "." # y); \
18
void x##y(void)
19
20
void
RegisterTest
(
void
(*)(
void
),
const
char
*);
21
22
class
TestRegisterer
{
23
public
:
24
TestRegisterer
(
void
(*
fn
)(
void
),
const
char
*s) {
25
RegisterTest
(
fn
, s);
26
}
27
};
28
29
// fatal assertions
30
#define ASSERT_TRUE CHECK
31
#define ASSERT_FALSE(x) CHECK(!(x))
32
#define ASSERT_EQ CHECK_EQ
33
#define ASSERT_NE CHECK_NE
34
#define ASSERT_LT CHECK_LT
35
#define ASSERT_LE CHECK_LE
36
#define ASSERT_GT CHECK_GT
37
#define ASSERT_GE CHECK_GE
38
39
// nonfatal assertions
40
// TODO(rsc): Do a better job?
41
#define EXPECT_TRUE CHECK
42
#define EXPECT_FALSE(x) CHECK(!(x))
43
#define EXPECT_EQ CHECK_EQ
44
#define EXPECT_NE CHECK_NE
45
#define EXPECT_LT CHECK_LT
46
#define EXPECT_LE CHECK_LE
47
#define EXPECT_GT CHECK_GT
48
#define EXPECT_GE CHECK_GE
49
50
#endif // UTIL_TEST_H_
testing
Definition:
aws_request_signer_test.cc:25
testing::TempDir
GTEST_API_ std::string TempDir()
Definition:
bloaty/third_party/googletest/googletest/src/gtest.cc:6140
testing::internal::string
::std::string string
Definition:
bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
TestRegisterer
Definition:
bloaty/third_party/re2/util/test.h:19
generate-asm-lcov.fn
fn
Definition:
generate-asm-lcov.py:146
TestRegisterer::TestRegisterer
TestRegisterer(void(*fn)(void), const char *s)
Definition:
re2/util/test.h:24
RegisterTest
void RegisterTest(void(*)(void), const char *)
Definition:
third_party/bloaty/third_party/re2/util/test.cc:19
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:27