}
static int count() { return count_; }
static RegisterThreadedTest* nth(int i) {
- ASSERT(i < count());
+ CHECK(i < count());
RegisterThreadedTest* current = first_;
while (i > 0) {
i--;
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"));
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());
}
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();
}
}
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();
}
}
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);
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) {
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(),
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);
}
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);
}
state_ = UNKNOWN;
return True();
default:
- ASSERT(state_ == UNKNOWN);
+ CHECK(state_ == UNKNOWN);
break;
}
// Do the lookup in the object.
state_ = UNKNOWN;
return False();
default:
- ASSERT(state_ == UNKNOWN);
+ CHECK(state_ == UNKNOWN);
break;
}
// Do the lookup in the object.
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);
// Add an existing element, the backing store should have to grow.
list.Add(list[0]);
- ASSERT(list[4] == 1);
+ CHECK(list[4] == 1);
}
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];
}
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) {