chromium/v8/test/unittests/heap/cppgc/ephemeron-pair-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 "include/cppgc/ephemeron-pair.h"

#include "include/cppgc/allocation.h"
#include "include/cppgc/garbage-collected.h"
#include "include/cppgc/persistent.h"
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/marking-visitor.h"
#include "src/heap/cppgc/stats-collector.h"
#include "test/unittests/heap/cppgc/tests.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cppgc {
namespace internal {

namespace {
class GCed : public GarbageCollected<GCed> {};

class EphemeronHolder : public GarbageCollected<EphemeronHolder> {};

class EphemeronHolderTraceEphemeron
    : public GarbageCollected<EphemeronHolderTraceEphemeron> {};

class EphemeronPairTest : public testing::TestWithHeap {};

// static
constexpr MarkingConfig EphemeronPairTest::IncrementalPreciseMarkingConfig;

}  // namespace

TEST_F(EphemeronPairTest, ValueMarkedWhenKeyIsMarked) {}

TEST_F(EphemeronPairTest, ValueNotMarkedWhenKeyIsNotMarked) {}

TEST_F(EphemeronPairTest, ValueNotMarkedBeforeKey) {}

TEST_F(EphemeronPairTest, TraceEphemeronDispatch) {}

TEST_F(EphemeronPairTest, EmptyValue) {}

TEST_F(EphemeronPairTest, EmptyKey) {}

EphemeronPairGCTest;

TEST_F(EphemeronPairGCTest, EphemeronPairValueIsCleared) {}

namespace {

class Mixin : public GarbageCollectedMixin {};

class OtherMixin : public GarbageCollectedMixin {};

class GCedWithMixin : public GarbageCollected<GCedWithMixin>,
                      public OtherMixin,
                      public Mixin {};

class EphemeronHolderWithMixins
    : public GarbageCollected<EphemeronHolderWithMixins> {};

}  // namespace

TEST_F(EphemeronPairTest, EphemeronPairWithMixinKey) {}

TEST_F(EphemeronPairTest, EphemeronPairWithEmptyMixinValue) {}

namespace {

class KeyWithCallback final : public GarbageCollected<KeyWithCallback> {};

class EphemeronHolderForKeyWithCallback final
    : public GarbageCollected<EphemeronHolderForKeyWithCallback> {};

}  // namespace

TEST_F(EphemeronPairTest, EphemeronPairWithKeyInConstruction) {}

}  // namespace internal
}  // namespace cppgc