#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 { … };
constexpr MarkingConfig EphemeronPairTest::IncrementalPreciseMarkingConfig;
}
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> { … };
}
TEST_F(EphemeronPairTest, EphemeronPairWithMixinKey) { … }
TEST_F(EphemeronPairTest, EphemeronPairWithEmptyMixinValue) { … }
namespace {
class KeyWithCallback final : public GarbageCollected<KeyWithCallback> { … };
class EphemeronHolderForKeyWithCallback final
: public GarbageCollected<EphemeronHolderForKeyWithCallback> { … };
}
TEST_F(EphemeronPairTest, EphemeronPairWithKeyInConstruction) { … }
}
}