Commit d8daf5f8 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5efbfcff
......@@ -161,7 +161,7 @@ class RegisterThreadedTest {
}
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 @@ THREADED_TEST(ArgumentSignature) {
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 @@ THREADED_TEST(ArgumentSignature) {
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());
}
......
......@@ -232,7 +232,7 @@ static int SetScriptBreakPointByIdFromJS(int script_id, int line, int column) {
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 @@ static int SetScriptBreakPointByNameFromJS(const char* script_name,
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 @@ TEST(DebugBreak) {
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 @@ ThreadBarrier::~ThreadBarrier() {
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 @@ TEST(MessageQueueExpandAndDestroy) {
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 @@ TEST(MessageQueueExpandAndDestroy) {
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 @@ TEST(SendClientDataToHandler) {
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);
}
......
......@@ -389,7 +389,7 @@ class AppearingPropertyContext: public DeclarationContext {
state_ = UNKNOWN;
return True();
default:
ASSERT(state_ == UNKNOWN);
CHECK(state_ == UNKNOWN);
break;
}
// Do the lookup in the object.
......@@ -479,7 +479,7 @@ class ReappearingPropertyContext: public DeclarationContext {
state_ = UNKNOWN;
return False();
default:
ASSERT(state_ == UNKNOWN);
CHECK(state_ == UNKNOWN);
break;
}
// Do the lookup in the object.
......
......@@ -43,7 +43,7 @@ class IntSet {
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);
......
......@@ -63,5 +63,5 @@ TEST(ListAdd) {
// Add an existing element, the backing store should have to grow.
list.Add(list[0]);
ASSERT(list[4] == 1);
CHECK(list[4] == 1);
}
......@@ -154,7 +154,7 @@ static Handle<String> ConstructBalancedHelper(
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 @@ static Handle<String> ConstructSliceTree(
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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment