]> git.proxmox.com Git - ceph.git/blame - ceph/src/rocksdb/monitoring/statistics_test.cc
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / monitoring / statistics_test.cc
CommitLineData
7c673cae
FG
1// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2// This source code is licensed under the BSD-style license found in the
3// LICENSE file in the root directory of this source tree. An additional grant
4// of patent rights can be found in the PATENTS file in the same directory.
5//
6
7#include "port/stack_trace.h"
8#include "util/testharness.h"
9#include "util/testutil.h"
10
11#include "rocksdb/statistics.h"
12
13namespace rocksdb {
14
15class StatisticsTest : public testing::Test {};
16
17// Sanity check to make sure that contents and order of TickersNameMap
18// match Tickers enum
19TEST_F(StatisticsTest, Sanity) {
20 EXPECT_EQ(static_cast<size_t>(Tickers::TICKER_ENUM_MAX),
21 TickersNameMap.size());
22
23 for (uint32_t t = 0; t < Tickers::TICKER_ENUM_MAX; t++) {
24 auto pair = TickersNameMap[static_cast<size_t>(t)];
25 ASSERT_EQ(pair.first, t) << "Miss match at " << pair.second;
26 }
27}
28
29} // namespace rocksdb
30
31int main(int argc, char** argv) {
32 rocksdb::port::InstallStackTraceHandler();
33 ::testing::InitGoogleTest(&argc, argv);
34 return RUN_ALL_TESTS();
35}