Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: test/cctest/test-ordered-hash-table.cc

Issue 259883002: ES6: Add support for Map and Set Iterator (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code review changes Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/mjsunit/harmony/collection-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-ordered-hash-table.cc
diff --git a/test/cctest/test-ordered-hash-table.cc b/test/cctest/test-ordered-hash-table.cc
index 1614e4b27e208afdbc5fdfe923f853852c7cf610..0d687cf972d9fed893ea4c3f5e334b731711f11c 100644
--- a/test/cctest/test-ordered-hash-table.cc
+++ b/test/cctest/test-ordered-hash-table.cc
@@ -37,21 +37,6 @@ namespace {
using namespace v8::internal;
-void CheckIterResultObject(Isolate* isolate,
- Handle<JSObject> result,
- Handle<Object> value,
- bool done) {
- Handle<Object> value_object =
- Object::GetProperty(isolate, result, "value").ToHandleChecked();
- Handle<Object> done_object =
- Object::GetProperty(isolate, result, "done").ToHandleChecked();
-
- CHECK_EQ(*value_object, *value);
- CHECK(done_object->IsBoolean());
- CHECK_EQ(done_object->BooleanValue(), done);
-}
-
-
TEST(Set) {
i::FLAG_harmony_collections = true;
@@ -64,11 +49,6 @@ TEST(Set) {
CHECK_EQ(0, ordered_set->NumberOfElements());
CHECK_EQ(0, ordered_set->NumberOfDeletedElements());
- Handle<JSSetIterator> value_iterator =
- JSSetIterator::Create(ordered_set, JSSetIterator::kKindValues);
- Handle<JSSetIterator> value_iterator_2 =
- JSSetIterator::Create(ordered_set, JSSetIterator::kKindValues);
-
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
Handle<JSObject> obj = factory->NewJSObjectFromMap(map);
CHECK(!ordered_set->Contains(obj));
@@ -97,18 +77,6 @@ TEST(Set) {
CHECK(ordered_set->Contains(obj2));
CHECK(ordered_set->Contains(obj3));
- // Test iteration
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator), obj1, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator), obj2, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator), obj3, false);
- CheckIterResultObject(isolate,
- JSSetIterator::Next(value_iterator),
- factory->undefined_value(),
- true);
-
// Test growth
ordered_set = OrderedHashSet::Add(ordered_set, obj);
Handle<JSObject> obj4 = factory->NewJSObjectFromMap(map);
@@ -122,22 +90,6 @@ TEST(Set) {
CHECK_EQ(0, ordered_set->NumberOfDeletedElements());
CHECK_EQ(4, ordered_set->NumberOfBuckets());
- // Test iteration after growth
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj1, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj2, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj3, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj, false);
- CheckIterResultObject(
- isolate, JSSetIterator::Next(value_iterator_2), obj4, false);
- CheckIterResultObject(isolate,
- JSSetIterator::Next(value_iterator_2),
- factory->undefined_value(),
- true);
-
// Test shrinking
ordered_set = OrderedHashSet::Remove(ordered_set, obj, &was_present);
CHECK(was_present);
@@ -164,11 +116,6 @@ TEST(Map) {
CHECK_EQ(0, ordered_map->NumberOfElements());
CHECK_EQ(0, ordered_map->NumberOfDeletedElements());
- Handle<JSMapIterator> value_iterator =
- JSMapIterator::Create(ordered_map, JSMapIterator::kKindValues);
- Handle<JSMapIterator> key_iterator =
- JSMapIterator::Create(ordered_map, JSMapIterator::kKindKeys);
-
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
Handle<JSObject> obj = factory->NewJSObjectFromMap(map);
Handle<JSObject> val = factory->NewJSObjectFromMap(map);
@@ -196,18 +143,6 @@ TEST(Map) {
CHECK(ordered_map->Lookup(obj2)->SameValue(*val2));
CHECK(ordered_map->Lookup(obj3)->SameValue(*val3));
- // Test iteration
- CheckIterResultObject(
- isolate, JSMapIterator::Next(value_iterator), val1, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(value_iterator), val2, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(value_iterator), val3, false);
- CheckIterResultObject(isolate,
- JSMapIterator::Next(value_iterator),
- factory->undefined_value(),
- true);
-
// Test growth
ordered_map = OrderedHashMap::Put(ordered_map, obj, val);
Handle<JSObject> obj4 = factory->NewJSObjectFromMap(map);
@@ -221,22 +156,6 @@ TEST(Map) {
CHECK_EQ(5, ordered_map->NumberOfElements());
CHECK_EQ(4, ordered_map->NumberOfBuckets());
- // Test iteration after growth
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj1, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj2, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj3, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj, false);
- CheckIterResultObject(
- isolate, JSMapIterator::Next(key_iterator), obj4, false);
- CheckIterResultObject(isolate,
- JSMapIterator::Next(key_iterator),
- factory->undefined_value(),
- true);
-
// Test shrinking
ordered_map = OrderedHashMap::Put(
ordered_map, obj, factory->the_hole_value());
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/mjsunit/harmony/collection-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698