]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/test_util/testharness.h
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
6 // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style license that can be
8 // found in the LICENSE file. See the AUTHORS file for names of contributors.
13 #include "gtest/gtest.h"
15 #include <gtest/gtest.h>
19 #include "rocksdb/env.h"
21 namespace ROCKSDB_NAMESPACE
{
24 // Return the directory to use for temporary storage.
25 std::string
TmpDir(Env
* env
= Env::Default());
27 // A path unique within the thread
28 std::string
PerThreadDBPath(std::string name
);
29 std::string
PerThreadDBPath(Env
* env
, std::string name
);
30 std::string
PerThreadDBPath(std::string dir
, std::string name
);
32 // Return a randomization seed for this run. Typically returns the
33 // same number on repeated invocations of this binary, but automated
34 // runs may be able to vary the seed.
37 ::testing::AssertionResult
AssertStatus(const char* s_expr
, const Status
& s
);
39 #define ASSERT_OK(s) \
40 ASSERT_PRED_FORMAT1(ROCKSDB_NAMESPACE::test::AssertStatus, s)
41 #define ASSERT_NOK(s) ASSERT_FALSE((s).ok())
42 #define EXPECT_OK(s) \
43 EXPECT_PRED_FORMAT1(ROCKSDB_NAMESPACE::test::AssertStatus, s)
44 #define EXPECT_NOK(s) EXPECT_FALSE((s).ok())
47 } // namespace ROCKSDB_NAMESPACE