Sha256: ead5930dd1e399ce2c8c0ffc3bfa94d4db264aa86e0ab5e7de9dcf75f35e1f11

Contents?: true

Size: 1.12 KB

Versions: 68

Compression:

Stored size: 1.12 KB

Contents

// Copyright 2009 The RE2 Authors.  All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#ifndef UTIL_TEST_H_
#define UTIL_TEST_H_

#include "util/util.h"
#include "util/logging.h"

namespace testing {
std::string TempDir();
}  // namespace testing

#define TEST(x, y) \
	void x##y(void); \
	TestRegisterer r##x##y(x##y, # x "." # y); \
	void x##y(void)

void RegisterTest(void (*)(void), const char*);

class TestRegisterer {
 public:
  TestRegisterer(void (*fn)(void), const char *s) {
    RegisterTest(fn, s);
  }
};

// fatal assertions
#define ASSERT_TRUE CHECK
#define ASSERT_FALSE(x) CHECK(!(x))
#define ASSERT_EQ CHECK_EQ
#define ASSERT_NE CHECK_NE
#define ASSERT_LT CHECK_LT
#define ASSERT_LE CHECK_LE
#define ASSERT_GT CHECK_GT
#define ASSERT_GE CHECK_GE

// nonfatal assertions
// TODO(rsc): Do a better job?
#define EXPECT_TRUE CHECK
#define EXPECT_FALSE(x) CHECK(!(x))
#define EXPECT_EQ CHECK_EQ
#define EXPECT_NE CHECK_NE
#define EXPECT_LT CHECK_LT
#define EXPECT_LE CHECK_LE
#define EXPECT_GT CHECK_GT
#define EXPECT_GE CHECK_GE

#endif  // UTIL_TEST_H_

Version data entries

68 entries across 68 versions & 3 rubygems

Version Path
grpc-1.57.0 third_party/re2/util/test.h
grpc-1.54.3 third_party/re2/util/test.h
grpc-1.53.2 third_party/re2/util/test.h
grpc-1.55.3 third_party/re2/util/test.h
grpc-1.57.0.pre1 third_party/re2/util/test.h
grpc-1.56.2 third_party/re2/util/test.h
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/third_party/re2/util/test.h
grpc-1.56.0 third_party/re2/util/test.h
grpc-1.56.0.pre3 third_party/re2/util/test.h
grpc-1.55.0 third_party/re2/util/test.h
grpc-1.53.1 third_party/re2/util/test.h
grpc-1.52.2 third_party/re2/util/test.h
grpc-1.54.2 third_party/re2/util/test.h
grpc-1.54.0 third_party/re2/util/test.h
grpc-1.53.0 third_party/re2/util/test.h
grpc-1.53.0.pre2 third_party/re2/util/test.h
grpc-1.52.0 third_party/re2/util/test.h
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/third_party/re2/util/test.h
grpc-1.51.0-x86_64-linux third_party/re2/util/test.h
grpc-1.51.0 third_party/re2/util/test.h