Skip to content

Commit

Permalink
Fix a Statistics-related unit test faulure
Browse files Browse the repository at this point in the history
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
  • Loading branch information
liukai committed Jan 22, 2014
1 parent 4e8321b commit 4036d58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util/statistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//
#include "util/statistics.h"
#include "rocksdb/statistics.h"
#include <algorithm>
#include <cstdio>

namespace rocksdb {
Expand All @@ -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() {}

Expand Down

0 comments on commit 4036d58

Please sign in to comment.