Author: [email protected]
Date: Fri Apr 24 07:29:42 2009
New Revision: 1793
Modified:
branches/bleeding_edge/test/cctest/test-api.cc
branches/bleeding_edge/test/cctest/test-debug.cc
branches/bleeding_edge/test/cctest/test-decls.cc
branches/bleeding_edge/test/cctest/test-hashmap.cc
branches/bleeding_edge/test/cctest/test-list.cc
branches/bleeding_edge/test/cctest/test-strings.cc
Log:
Changed the ASSERT's in the cctest's to CHECK's.
There are no ASSERTS left in the cctest's.
Review URL: http://codereview.chromium.org/93120
Modified: branches/bleeding_edge/test/cctest/test-api.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-api.cc (original)
+++ branches/bleeding_edge/test/cctest/test-api.cc Fri Apr 24 07:29:42 2009
@@ -161,7 +161,7 @@
}
static int count() { return count_; }
static RegisterThreadedTest* nth(int i) {
- ASSERT(i < count());
+ CHECK(i < count());
RegisterThreadedTest* current = first_;
while (i > 0) {
i--;
@@ -295,13 +295,13 @@
env->Global()->Set(v8_str("Fun1"), fun->GetFunction());
v8::Handle<Value> value1 = CompileRun("Fun1(4) == '';");
- ASSERT(value1->IsTrue());
+ CHECK(value1->IsTrue());
v8::Handle<Value> value2 = CompileRun("Fun1(new Cons()) == '[object
Cons]';");
- ASSERT(value2->IsTrue());
+ CHECK(value2->IsTrue());
v8::Handle<Value> value3 = CompileRun("Fun1() == '';");
- ASSERT(value3->IsTrue());
+ CHECK(value3->IsTrue());
v8::Handle<v8::FunctionTemplate> cons1 = v8::FunctionTemplate::New();
cons1->SetClassName(v8_str("Cons1"));
@@ -323,24 +323,24 @@
v8::Handle<Value> value4 = CompileRun(
"Fun2(new Cons1(), new Cons2(), new Cons3()) =="
"'[object Cons1],[object Cons2],[object Cons3]'");
- ASSERT(value4->IsTrue());
+ CHECK(value4->IsTrue());
v8::Handle<Value> value5 = CompileRun(
"Fun2(new Cons1(), new Cons2(), 5) == '[object Cons1],[object
Cons2],'");
- ASSERT(value5->IsTrue());
+ CHECK(value5->IsTrue());
v8::Handle<Value> value6 = CompileRun(
"Fun2(new Cons3(), new Cons2(), new Cons1()) == ',[object Cons2],'");
- ASSERT(value6->IsTrue());
+ CHECK(value6->IsTrue());
v8::Handle<Value> value7 = CompileRun(
"Fun2(new Cons1(), new Cons2(), new Cons3(), 'd') == "
"'[object Cons1],[object Cons2],[object Cons3],d';");
- ASSERT(value7->IsTrue());
+ CHECK(value7->IsTrue());
v8::Handle<Value> value8 = CompileRun(
"Fun2(new Cons1(), new Cons2()) == '[object Cons1],[object Cons2]'");
- ASSERT(value8->IsTrue());
+ CHECK(value8->IsTrue());
}
Modified: branches/bleeding_edge/test/cctest/test-debug.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-debug.cc (original)
+++ branches/bleeding_edge/test/cctest/test-debug.cc Fri Apr 24 07:29:42
2009
@@ -232,7 +232,7 @@
v8::TryCatch try_catch;
v8::Handle<v8::String> str = v8::String::New(buffer.start());
v8::Handle<v8::Value> value = v8::Script::Compile(str)->Run();
- ASSERT(!try_catch.HasCaught());
+ CHECK(!try_catch.HasCaught());
return value->Int32Value();
}
}
@@ -259,7 +259,7 @@
v8::TryCatch try_catch;
v8::Handle<v8::String> str = v8::String::New(buffer.start());
v8::Handle<v8::Value> value = v8::Script::Compile(str)->Run();
- ASSERT(!try_catch.HasCaught());
+ CHECK(!try_catch.HasCaught());
return value->Int32Value();
}
}
@@ -2945,9 +2945,11 @@
v8::HandleScope scope;
DebugLocalContext env;
- // This test should be run with option --verify-heap. This is an ASSERT
and
- // not a CHECK as --verify-heap is only available in debug mode.
- ASSERT(v8::internal::FLAG_verify_heap);
+ // This test should be run with option --verify-heap. As --verify-heap is
+ // only available in debug mode only check for it in that case.
+#ifdef DEBUG
+ CHECK(v8::internal::FLAG_verify_heap);
+#endif
// Register a debug event listener which sets the break flag and counts.
v8::Debug::SetDebugEventListener(DebugEventBreak);
@@ -3361,7 +3363,7 @@
void ThreadBarrier::Wait() {
lock_->Lock();
- ASSERT(!invalid_);
+ CHECK(!invalid_);
if (num_blocked_ == num_threads_ - 1) {
// Signal and unblock all waiting threads.
for (int i = 0; i < num_threads_ - 1; ++i) {
@@ -3566,9 +3568,9 @@
new TestClientData()));
queue.Put(CommandMessage::New(Vector<uint16_t>::empty(),
new TestClientData()));
- ASSERT_EQ(0, TestClientData::destructor_call_counter);
+ CHECK_EQ(0, TestClientData::destructor_call_counter);
queue.Get().Dispose();
- ASSERT_EQ(1, TestClientData::destructor_call_counter);
+ CHECK_EQ(1, TestClientData::destructor_call_counter);
queue.Put(CommandMessage::New(Vector<uint16_t>::empty(),
new TestClientData()));
queue.Put(CommandMessage::New(Vector<uint16_t>::empty(),
@@ -3579,13 +3581,13 @@
new TestClientData()));
queue.Put(CommandMessage::New(Vector<uint16_t>::empty(),
new TestClientData()));
- ASSERT_EQ(1, TestClientData::destructor_call_counter);
+ CHECK_EQ(1, TestClientData::destructor_call_counter);
queue.Get().Dispose();
- ASSERT_EQ(2, TestClientData::destructor_call_counter);
+ CHECK_EQ(2, TestClientData::destructor_call_counter);
}
// All the client data should be destroyed when the queue is destroyed.
- ASSERT_EQ(TestClientData::destructor_call_counter,
- TestClientData::destructor_call_counter);
+ CHECK_EQ(TestClientData::destructor_call_counter,
+ TestClientData::destructor_call_counter);
}
@@ -3635,11 +3637,11 @@
new TestClientData());
v8::Debug::SendCommand(buffer, AsciiToUtf16(command_continue, buffer));
CompileRun(source_1);
- ASSERT_EQ(3, TestClientData::constructor_call_counter);
- ASSERT_EQ(TestClientData::constructor_call_counter,
- handled_client_data_instances_count);
- ASSERT_EQ(TestClientData::constructor_call_counter,
- TestClientData::destructor_call_counter);
+ CHECK_EQ(3, TestClientData::constructor_call_counter);
+ CHECK_EQ(TestClientData::constructor_call_counter,
+ handled_client_data_instances_count);
+ CHECK_EQ(TestClientData::constructor_call_counter,
+ TestClientData::destructor_call_counter);
}
Modified: branches/bleeding_edge/test/cctest/test-decls.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-decls.cc (original)
+++ branches/bleeding_edge/test/cctest/test-decls.cc Fri Apr 24 07:29:42
2009
@@ -389,7 +389,7 @@
state_ = UNKNOWN;
return True();
default:
- ASSERT(state_ == UNKNOWN);
+ CHECK(state_ == UNKNOWN);
break;
}
// Do the lookup in the object.
@@ -479,7 +479,7 @@
state_ = UNKNOWN;
return False();
default:
- ASSERT(state_ == UNKNOWN);
+ CHECK(state_ == UNKNOWN);
break;
}
// Do the lookup in the object.
Modified: branches/bleeding_edge/test/cctest/test-hashmap.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-hashmap.cc (original)
+++ branches/bleeding_edge/test/cctest/test-hashmap.cc Fri Apr 24 07:29:42
2009
@@ -43,7 +43,7 @@
IntSet() : map_(DefaultMatchFun) {}
void Insert(int x) {
- ASSERT(x != 0); // 0 corresponds to (void*)NULL - illegal key value
+ CHECK(x != 0); // 0 corresponds to (void*)NULL - illegal key value
HashMap::Entry* p = map_.Lookup(reinterpret_cast<void*>(x), Hash(x),
true);
CHECK(p != NULL); // insert is set!
CHECK_EQ(reinterpret_cast<void*>(x), p->key);
Modified: branches/bleeding_edge/test/cctest/test-list.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-list.cc (original)
+++ branches/bleeding_edge/test/cctest/test-list.cc Fri Apr 24 07:29:42 2009
@@ -63,5 +63,5 @@
// Add an existing element, the backing store should have to grow.
list.Add(list[0]);
- ASSERT(list[4] == 1);
+ CHECK(list[4] == 1);
}
Modified: branches/bleeding_edge/test/cctest/test-strings.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-strings.cc (original)
+++ branches/bleeding_edge/test/cctest/test-strings.cc Fri Apr 24 07:29:42
2009
@@ -154,7 +154,7 @@
Handle<String> building_blocks[NUMBER_OF_BUILDING_BLOCKS],
int from,
int to) {
- ASSERT(to > from);
+ CHECK(to > from);
if (to - from == 1) {
return building_blocks[from % NUMBER_OF_BUILDING_BLOCKS];
}
@@ -279,7 +279,7 @@
Handle<String> building_blocks[NUMBER_OF_BUILDING_BLOCKS],
int from,
int to) {
- ASSERT(to > from);
+ CHECK(to > from);
if (to - from <= 1)
return SliceOf(building_blocks[from % NUMBER_OF_BUILDING_BLOCKS]);
if (to - from == 2) {
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---