2016-02-09 23:12:00 +00:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2013-10-16 21:59:46 +00:00
|
|
|
// This source code is licensed under the BSD-style license found in the
|
|
|
|
// LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
// of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
//
|
2011-03-18 22:37:00 +00:00
|
|
|
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
|
|
|
|
2013-10-05 05:32:05 +00:00
|
|
|
#pragma once
|
2011-03-18 22:37:00 +00:00
|
|
|
|
2015-03-17 21:08:00 +00:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
2014-10-31 22:08:10 +00:00
|
|
|
#include <string>
|
2013-08-23 15:38:13 +00:00
|
|
|
#include "rocksdb/env.h"
|
2011-03-18 22:37:00 +00:00
|
|
|
|
2013-10-04 04:49:15 +00:00
|
|
|
namespace rocksdb {
|
2011-03-18 22:37:00 +00:00
|
|
|
namespace test {
|
|
|
|
|
|
|
|
// Return the directory to use for temporary storage.
|
2015-03-19 23:52:59 +00:00
|
|
|
std::string TmpDir(Env* env = Env::Default());
|
2011-03-18 22:37:00 +00:00
|
|
|
|
|
|
|
// Return a randomization seed for this run. Typically returns the
|
|
|
|
// same number on repeated invocations of this binary, but automated
|
|
|
|
// runs may be able to vary the seed.
|
2015-03-19 23:52:59 +00:00
|
|
|
int RandomSeed();
|
2011-03-18 22:37:00 +00:00
|
|
|
|
2015-03-20 00:32:43 +00:00
|
|
|
::testing::AssertionResult AssertStatus(const char* s_expr, const Status& s);
|
|
|
|
|
|
|
|
#define ASSERT_OK(s) ASSERT_PRED_FORMAT1(rocksdb::test::AssertStatus, s)
|
|
|
|
#define ASSERT_NOK(s) ASSERT_FALSE((s).ok())
|
|
|
|
#define EXPECT_OK(s) EXPECT_PRED_FORMAT1(rocksdb::test::AssertStatus, s)
|
|
|
|
#define EXPECT_NOK(s) EXPECT_FALSE((s).ok())
|
2011-03-18 22:37:00 +00:00
|
|
|
|
2011-10-31 17:22:06 +00:00
|
|
|
} // namespace test
|
2013-10-04 04:49:15 +00:00
|
|
|
} // namespace rocksdb
|