Commit ede03cd9 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Add unit tests for Worklist::FlushToGlobal.

BUG=chromium:694255

Change-Id: I3e9c5e6b47b4dd0fbd2524b3329dbef14d4ad4e7
Reviewed-on: https://chromium-review.googlesource.com/550158Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46267}
parent 59157272
......@@ -191,6 +191,32 @@ TEST(Worklist, GlobalUpdate) {
}
}
TEST(Worklist, FlushToGlobalPushSegment) {
Worklist worklist;
WorklistView worklist_view0(&worklist, 0);
WorklistView worklist_view1(&worklist, 1);
HeapObject* object = nullptr;
HeapObject* objectA = nullptr;
objectA = reinterpret_cast<HeapObject*>(&objectA);
EXPECT_TRUE(worklist_view0.Push(objectA));
worklist.FlushToGlobal(0);
EXPECT_TRUE(worklist_view1.Pop(&object));
}
TEST(Worklist, FlushToGlobalPopSegment) {
Worklist worklist;
WorklistView worklist_view0(&worklist, 0);
WorklistView worklist_view1(&worklist, 1);
HeapObject* object = nullptr;
HeapObject* objectA = nullptr;
objectA = reinterpret_cast<HeapObject*>(&objectA);
EXPECT_TRUE(worklist_view0.Push(objectA));
EXPECT_TRUE(worklist_view0.Push(objectA));
EXPECT_TRUE(worklist_view0.Pop(&object));
worklist.FlushToGlobal(0);
EXPECT_TRUE(worklist_view1.Pop(&object));
}
TEST(Worklist, Clear) {
Worklist worklist;
WorklistView worklist_view(&worklist, 0);
......
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