Fix a Statistics-related unit test faulure

Summary:
In my MacOS, the member variables are populated with random numbers after initialization.
This diff fixes it by fill these arrays with 0.

Test Plan: make && ./table_test

Reviewers: igor

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15315
This commit is contained in:
kailiu 2014-01-21 17:51:36 -08:00
parent 4e8321bfea
commit 4036d58dc9
1 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@
//
#include "util/statistics.h"
#include "rocksdb/statistics.h"
#include <algorithm>
#include <cstdio>
namespace rocksdb {
@ -13,7 +14,11 @@ std::shared_ptr<Statistics> CreateDBStatistics() {
return std::make_shared<StatisticsImpl>();
}
StatisticsImpl::StatisticsImpl() {}
StatisticsImpl::StatisticsImpl() {
// Fill tickers_ with "zero". To ensure plasform indepedent, we used
// uint_fast64_t() instead literal `0` to represent zero.
std::fill(tickers_, tickers_ + TICKER_ENUM_MAX, uint_fast64_t());
}
StatisticsImpl::~StatisticsImpl() {}