#include "include/cppgc/internal/finalizer-trait.h"
#include <type_traits>
#include "testing/gtest/include/gtest/gtest.h"
namespace cppgc {
namespace internal {
namespace {
class TypeWithoutDestructor final { … };
class TypeWithPrimitive final { … };
class InvokeCounter { … };
size_t InvokeCounter::kCallcount = …;
class TypeWithDestructor final : public InvokeCounter { … };
class TypeWithVirtualDestructorBase { … };
class TypeWithVirtualDestructorChild final
: public TypeWithVirtualDestructorBase,
public InvokeCounter { … };
class TypeWithCustomFinalizationMethod final : public InvokeCounter { … };
class TypeWithCustomFinalizationMethodAtBase { … };
class TypeWithCustomFinalizationMethodAtBaseChild
: public TypeWithCustomFinalizationMethodAtBase,
public InvokeCounter { … };
void TypeWithCustomFinalizationMethodAtBase::FinalizeGarbageCollectedObject() { … }
template <typename Type>
void ExpectFinalizerIsInvoked(Type* object) { … }
}
TEST(FinalizerTrait, TypeWithoutDestructorHasNoFinalizer) { … }
TEST(FinalizerTrait, TypeWithPrimitiveHasNoFinalizer) { … }
TEST(FinalizerTrait, FinalizerForTypeWithDestructor) { … }
TEST(FinalizerTrait, FinalizerForTypeWithVirtualBaseDtor) { … }
TEST(FinalizerTrait, FinalizerForCustomFinalizationMethod) { … }
TEST(FinalizerTrait, FinalizerForCustomFinalizationMethodInBase) { … }
}
}