diff options
-rw-r--r-- | base/allocator/allocator_unittests.cc | 2 | ||||
-rw-r--r-- | base/condition_variable_win.cc | 1 | ||||
-rw-r--r-- | base/crypto/rsa_private_key.cc | 2 | ||||
-rw-r--r-- | base/crypto/rsa_private_key_win.cc | 2 | ||||
-rw-r--r-- | base/leak_tracker.h | 2 | ||||
-rw-r--r-- | base/message_pump_glib.cc | 2 | ||||
-rw-r--r-- | base/pickle.cc | 2 | ||||
-rw-r--r-- | base/test/test_file_util_win.cc | 4 | ||||
-rw-r--r-- | base/thread_local_posix.cc | 4 | ||||
-rw-r--r-- | base/thread_local_win.cc | 2 | ||||
-rw-r--r-- | base/waitable_event_win.cc | 2 |
11 files changed, 12 insertions, 13 deletions
diff --git a/base/allocator/allocator_unittests.cc b/base/allocator/allocator_unittests.cc index fdda081..b1aa9cb 100644 --- a/base/allocator/allocator_unittests.cc +++ b/base/allocator/allocator_unittests.cc @@ -407,7 +407,7 @@ TEST(Allocators, Realloc1) { // Test again, but this time reallocing smaller first. for (int d = 0; d < s*2; ++d) { void* new_p = realloc(p, start_sizes[s] - deltas[d]); - CHECK(p == new_p); // realloc should not allocate new memory + CHECK_EQ(p, new_p); // realloc should not allocate new memory } free(p); } diff --git a/base/condition_variable_win.cc b/base/condition_variable_win.cc index f48adb6..5150c23 100644 --- a/base/condition_variable_win.cc +++ b/base/condition_variable_win.cc @@ -117,7 +117,6 @@ ConditionVariable::Event* ConditionVariable::GetEventForWaiting() { cv_event = new Event(); cv_event->InitListElement(); allocation_counter_++; - // CHECK_NE is not defined in our codebase, so we have to use CHECK CHECK(cv_event->handle()); } else { cv_event = recycling_list_.PopFront(); diff --git a/base/crypto/rsa_private_key.cc b/base/crypto/rsa_private_key.cc index 0c83b37..8b88b84 100644 --- a/base/crypto/rsa_private_key.cc +++ b/base/crypto/rsa_private_key.cc @@ -71,7 +71,7 @@ void PrivateKeyInfoCodec::PrependLength(size_t size, std::list<uint8>* data) { size >>= 8; num_bytes++; } - CHECK(num_bytes <= 4); + CHECK_LE(num_bytes, 4); data->push_front(0x80 | num_bytes); } } diff --git a/base/crypto/rsa_private_key_win.cc b/base/crypto/rsa_private_key_win.cc index 3683d86..870d650 100644 --- a/base/crypto/rsa_private_key_win.cc +++ b/base/crypto/rsa_private_key_win.cc @@ -171,7 +171,7 @@ bool RSAPrivateKey::ExportPrivateKey(std::vector<uint8>* output) { pki.public_exponent()->assign(reinterpret_cast<uint8*>(&rsa_pub_key->pubexp), reinterpret_cast<uint8*>(&rsa_pub_key->pubexp) + 4); - CHECK((pos - blob_length) == reinterpret_cast<BYTE*>(publickey_struct)); + CHECK_EQ(pos - blob_length, reinterpret_cast<BYTE*>(publickey_struct)); return pki.Export(output); } diff --git a/base/leak_tracker.h b/base/leak_tracker.h index ed3f38b..46e7b4a 100644 --- a/base/leak_tracker.h +++ b/base/leak_tracker.h @@ -93,7 +93,7 @@ class LeakTracker : public LinkNode<LeakTracker<T> > { allocation_stack.OutputToStream(&LOG(ERROR)); } - CHECK(0u == count); + CHECK_EQ(0u, count); // Hack to keep |stacktraces| and |count| alive (so compiler // doesn't optimize it out, and it will appear in mini-dumps). diff --git a/base/message_pump_glib.cc b/base/message_pump_glib.cc index 630c2f9..f027fdc 100644 --- a/base/message_pump_glib.cc +++ b/base/message_pump_glib.cc @@ -130,7 +130,7 @@ MessagePumpForUI::MessagePumpForUI() wakeup_gpollfd_(new GPollFD) { // Create our wakeup pipe, which is used to flag when work was scheduled. int fds[2]; - CHECK(pipe(fds) == 0); + CHECK_EQ(pipe(fds), 0); wakeup_pipe_read_ = fds[0]; wakeup_pipe_write_ = fds[1]; wakeup_gpollfd_->fd = wakeup_pipe_read_; diff --git a/base/pickle.cc b/base/pickle.cc index 2540391..4fa206e 100644 --- a/base/pickle.cc +++ b/base/pickle.cc @@ -377,7 +377,7 @@ void Pickle::TrimWriteData(int new_length) { bool Pickle::Resize(size_t new_capacity) { new_capacity = AlignInt(new_capacity, kPayloadUnit); - CHECK(capacity_ != kCapacityReadOnly); + CHECK_NE(capacity_, kCapacityReadOnly); void* p = realloc(header_, new_capacity); if (!p) return false; diff --git a/base/test/test_file_util_win.cc b/base/test/test_file_util_win.cc index 4f561f6..c15efa2 100644 --- a/base/test/test_file_util_win.cc +++ b/base/test/test_file_util_win.cc @@ -107,8 +107,8 @@ bool EvictFileFromSystemCache(const FilePath& file) { file_handle.Set(NULL); file_handle.Set(CreateFile(file.value().c_str(), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL)); - CHECK(SetFilePointer(file_handle, total_bytes, NULL, FILE_BEGIN) != - INVALID_SET_FILE_POINTER); + CHECK_NE(SetFilePointer(file_handle, total_bytes, NULL, FILE_BEGIN), + INVALID_SET_FILE_POINTER); CHECK(::SetEndOfFile(file_handle)); } diff --git a/base/thread_local_posix.cc b/base/thread_local_posix.cc index 4c29263..2abfc0e 100644 --- a/base/thread_local_posix.cc +++ b/base/thread_local_posix.cc @@ -13,7 +13,7 @@ namespace base { // static void ThreadLocalPlatform::AllocateSlot(SlotType& slot) { int error = pthread_key_create(&slot, NULL); - CHECK(error == 0); + CHECK_EQ(error, 0); } // static @@ -30,7 +30,7 @@ void* ThreadLocalPlatform::GetValueFromSlot(SlotType& slot) { // static void ThreadLocalPlatform::SetValueInSlot(SlotType& slot, void* value) { int error = pthread_setspecific(slot, value); - CHECK(error == 0); + CHECK_EQ(error, 0); } } // namespace base diff --git a/base/thread_local_win.cc b/base/thread_local_win.cc index 2da3cfd..27a894c 100644 --- a/base/thread_local_win.cc +++ b/base/thread_local_win.cc @@ -13,7 +13,7 @@ namespace base { // static void ThreadLocalPlatform::AllocateSlot(SlotType& slot) { slot = TlsAlloc(); - CHECK(slot != TLS_OUT_OF_INDEXES); + CHECK_NE(slot, TLS_OUT_OF_INDEXES); } // static diff --git a/base/waitable_event_win.cc b/base/waitable_event_win.cc index d063b3f..3d0eb14 100644 --- a/base/waitable_event_win.cc +++ b/base/waitable_event_win.cc @@ -76,7 +76,7 @@ bool WaitableEvent::TimedWait(const TimeDelta& max_time) { // static size_t WaitableEvent::WaitMany(WaitableEvent** events, size_t count) { HANDLE handles[MAXIMUM_WAIT_OBJECTS]; - CHECK(count <= MAXIMUM_WAIT_OBJECTS) + CHECK_LE(count, MAXIMUM_WAIT_OBJECTS) << "Can only wait on " << MAXIMUM_WAIT_OBJECTS << " with WaitMany"; for (size_t i = 0; i < count; ++i) |