[heap] Add unit tests for Worklist::FlushToGlobal.
BUG=chromium:694255 Change-Id: I3e9c5e6b47b4dd0fbd2524b3329dbef14d4ad4e7 Reviewed-on: https://chromium-review.googlesource.com/550158 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#46267}
This commit is contained in:
parent
59157272a0
commit
ede03cd97e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user