提交 39cfbd04 编写于 作者: S Stefan Weil

unittest: Replace NULL by nullptr

Signed-off-by: NStefan Weil <sw@weilnetz.de>
上级 5eca9143
...@@ -32,10 +32,10 @@ namespace { ...@@ -32,10 +32,10 @@ namespace {
class QuickTest : public testing::Test { class QuickTest : public testing::Test {
protected: protected:
virtual void SetUp() { virtual void SetUp() {
start_time_ = time(NULL); start_time_ = time(nullptr);
} }
virtual void TearDown() { virtual void TearDown() {
const time_t end_time = time(NULL); const time_t end_time = time(nullptr);
EXPECT_TRUE(end_time - start_time_ <=25) << "The test took too long - " << ::testing::PrintToString(end_time - start_time_); EXPECT_TRUE(end_time - start_time_ <=25) << "The test took too long - " << ::testing::PrintToString(end_time - start_time_);
} }
time_t start_time_; time_t start_time_;
......
...@@ -135,7 +135,7 @@ class UnicharcompressTest : public ::testing::Test { ...@@ -135,7 +135,7 @@ class UnicharcompressTest : public ::testing::Test {
RecodedCharID extended = code; RecodedCharID extended = code;
int length = code.length(); int length = code.length();
const GenericVector<int>* final_codes = compressed_.GetFinalCodes(code); const GenericVector<int>* final_codes = compressed_.GetFinalCodes(code);
if (final_codes != NULL) { if (final_codes != nullptr) {
for (int i = 0; i < final_codes->size(); ++i) { for (int i = 0; i < final_codes->size(); ++i) {
int ending = (*final_codes)[i]; int ending = (*final_codes)[i];
EXPECT_GT(times_seen[ending](length), 0); EXPECT_GT(times_seen[ending](length), 0);
...@@ -145,7 +145,7 @@ class UnicharcompressTest : public ::testing::Test { ...@@ -145,7 +145,7 @@ class UnicharcompressTest : public ::testing::Test {
} }
} }
const GenericVector<int>* next_codes = compressed_.GetNextCodes(code); const GenericVector<int>* next_codes = compressed_.GetNextCodes(code);
if (next_codes != NULL) { if (next_codes != nullptr) {
for (int i = 0; i < next_codes->size(); ++i) { for (int i = 0; i < next_codes->size(); ++i) {
int extension = (*next_codes)[i]; int extension = (*next_codes)[i];
EXPECT_GT(times_seen[extension](length), 0); EXPECT_GT(times_seen[extension](length), 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册