summaryrefslogtreecommitdiffstats
path: root/googletest/samples/sample8_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/samples/sample8_unittest.cc')
-rw-r--r--googletest/samples/sample8_unittest.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/googletest/samples/sample8_unittest.cc b/googletest/samples/sample8_unittest.cc
index ce75cf0..ccf5aed 100644
--- a/googletest/samples/sample8_unittest.cc
+++ b/googletest/samples/sample8_unittest.cc
@@ -50,8 +50,9 @@ class HybridPrimeTable : public PrimeTable {
public:
HybridPrimeTable(bool force_on_the_fly, int max_precalculated)
: on_the_fly_impl_(new OnTheFlyPrimeTable),
- precalc_impl_(force_on_the_fly ? NULL :
- new PreCalculatedPrimeTable(max_precalculated)),
+ precalc_impl_(force_on_the_fly
+ ? nullptr
+ : new PreCalculatedPrimeTable(max_precalculated)),
max_precalculated_(max_precalculated) {}
virtual ~HybridPrimeTable() {
delete on_the_fly_impl_;
@@ -59,7 +60,7 @@ class HybridPrimeTable : public PrimeTable {
}
virtual bool IsPrime(int n) const {
- if (precalc_impl_ != NULL && n < max_precalculated_)
+ if (precalc_impl_ != nullptr && n < max_precalculated_)
return precalc_impl_->IsPrime(n);
else
return on_the_fly_impl_->IsPrime(n);
@@ -67,7 +68,7 @@ class HybridPrimeTable : public PrimeTable {
virtual int GetNextPrime(int p) const {
int next_prime = -1;
- if (precalc_impl_ != NULL && p < max_precalculated_)
+ if (precalc_impl_ != nullptr && p < max_precalculated_)
next_prime = precalc_impl_->GetNextPrime(p);
return next_prime != -1 ? next_prime : on_the_fly_impl_->GetNextPrime(p);
@@ -106,7 +107,7 @@ class PrimeTableTest : public TestWithParam< ::testing::tuple<bool, int> > {
}
virtual void TearDown() {
delete table_;
- table_ = NULL;
+ table_ = nullptr;
}
HybridPrimeTable* table_;
};