chromium/v8/test/unittests/heap/cppgc/compactor-unittest.cc

// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/heap/cppgc/compactor.h"

#include "include/cppgc/allocation.h"
#include "include/cppgc/custom-space.h"
#include "include/cppgc/persistent.h"
#include "src/heap/cppgc/garbage-collector.h"
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/heap-page.h"
#include "src/heap/cppgc/marker.h"
#include "src/heap/cppgc/stats-collector.h"
#include "test/unittests/heap/cppgc/tests.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cppgc {

class CompactableCustomSpace : public CustomSpace<CompactableCustomSpace> {};

namespace internal {

namespace {

struct CompactableGCed : public GarbageCollected<CompactableGCed> {};
// static
size_t CompactableGCed::g_destructor_callcount =;

template <int kNumObjects>
struct CompactableHolder
    : public GarbageCollected<CompactableHolder<kNumObjects>> {};

class CompactorTest : public testing::TestWithPlatform {};

}  // namespace

}  // namespace internal

template <>
struct SpaceTrait<internal::CompactableGCed> {};

namespace internal {

TEST_F(CompactorTest, NothingToCompact) {}

TEST_F(CompactorTest, NonEmptySpaceAllLive) {}

TEST_F(CompactorTest, NonEmptySpaceAllDead) {}

TEST_F(CompactorTest, NonEmptySpaceHalfLive) {}

TEST_F(CompactorTest, CompactAcrossPages) {}

TEST_F(CompactorTest, InteriorSlotToPreviousObject) {}

TEST_F(CompactorTest, InteriorSlotToNextObject) {}

TEST_F(CompactorTest, OnStackSlotShouldBeFiltered) {}

}  // namespace internal
}  // namespace cppgc