/* * Copyright 2010-2023 Branimir Karadzic. All rights reserved. * License: https://github.com/bkaradzic/bx/blob/master/LICENSE */ #include "test.h" #include struct TestClass { }; struct TestClassFinal final { }; struct TestClassMember { int32_t x; }; struct TestClassMemberPrivate { int32_t x; private: int32_t y; }; struct TestClassStaticOnly { static int32_t x; }; struct TestClassCtor { TestClassCtor (const TestClassCtor&) {} }; struct TestClassDefaultCtor { TestClassDefaultCtor (const TestClassDefaultCtor&) = default; }; struct TestClassDefaultDtor { ~TestClassDefaultDtor () = default; }; struct TestClassVirtualDtor { virtual ~TestClassVirtualDtor () = default; }; struct TestClassAbstractBase { virtual ~TestClassAbstractBase() = 0; }; struct TestClassPolymorphic { virtual int32_t x() { return 1389; } }; struct TestClassDerivedA /* */ : TestClass { }; struct TestClassDerivedB /* */ : TestClassDerivedA { }; struct TestClassDerivedX /* */ : TestClassVirtualDtor { }; union TestUnionEmpty { }; union TestUnion { int32_t x; float y; }; enum TestEnumEmpty { }; enum TestEnum { Enum }; TEST_CASE("type-traits isReference", "") { STATIC_REQUIRE(!bx::isReference() ); STATIC_REQUIRE( bx::isReference() ); STATIC_REQUIRE( bx::isReference() ); STATIC_REQUIRE(!bx::isReference() ); STATIC_REQUIRE( bx::isReference() ); STATIC_REQUIRE( bx::isReference() ); STATIC_REQUIRE(!bx::isReference() ); STATIC_REQUIRE( bx::isReference() ); STATIC_REQUIRE( bx::isReference() );; } TEST_CASE("type-traits isLvalueReference", "") { STATIC_REQUIRE(!bx::isLvalueReference() ); STATIC_REQUIRE( bx::isLvalueReference() ); STATIC_REQUIRE(!bx::isLvalueReference() ); STATIC_REQUIRE(!bx::isLvalueReference() ); STATIC_REQUIRE( bx::isLvalueReference() ); STATIC_REQUIRE(!bx::isLvalueReference() ); STATIC_REQUIRE(!bx::isLvalueReference() ); STATIC_REQUIRE( bx::isLvalueReference() ); STATIC_REQUIRE(!bx::isLvalueReference() );; } TEST_CASE("type-traits isRvalueReference", "") { STATIC_REQUIRE(!bx::isRvalueReference() ); STATIC_REQUIRE(!bx::isRvalueReference() ); STATIC_REQUIRE( bx::isRvalueReference() ); STATIC_REQUIRE(!bx::isRvalueReference() ); STATIC_REQUIRE(!bx::isRvalueReference() ); STATIC_REQUIRE( bx::isRvalueReference() ); STATIC_REQUIRE(!bx::isRvalueReference() ); STATIC_REQUIRE(!bx::isRvalueReference() ); STATIC_REQUIRE( bx::isRvalueReference() );; } TEST_CASE("type-traits isPointer", "") { STATIC_REQUIRE(!bx::isPointer() ); STATIC_REQUIRE(!bx::isPointer() ); STATIC_REQUIRE( bx::isPointer() ); STATIC_REQUIRE( bx::isPointer() ); STATIC_REQUIRE(!bx::isPointer() ); STATIC_REQUIRE( bx::isPointer() ); STATIC_REQUIRE(!bx::isPointer() ); } TEST_CASE("type-traits AddLvalueReferenceT", "") { STATIC_REQUIRE( bx::isSame, TestClass& >() ); STATIC_REQUIRE( bx::isSame, TestClass& >() ); STATIC_REQUIRE( bx::isSame, TestClass& >() ); STATIC_REQUIRE( bx::isLvalueReference >() ); STATIC_REQUIRE( bx::isLvalueReference >() ); STATIC_REQUIRE( bx::isLvalueReference >() ); } TEST_CASE("type-traits AddRvalueReferenceT", "") { STATIC_REQUIRE( bx::isSame, TestClass&& >() ); STATIC_REQUIRE( bx::isSame, TestClass& >() ); STATIC_REQUIRE( bx::isSame, TestClass&& >() ); STATIC_REQUIRE( bx::isRvalueReference >() ); STATIC_REQUIRE(!bx::isRvalueReference >() ); STATIC_REQUIRE( bx::isRvalueReference >() ); } TEST_CASE("type-traits RemoveReferenceT", "") { STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE(!bx::isReference >() ); STATIC_REQUIRE(!bx::isReference >() ); STATIC_REQUIRE(!bx::isReference >() ); } TEST_CASE("type-traits AddPointerT", "") { STATIC_REQUIRE( bx::isSame, TestClass* >() ); STATIC_REQUIRE( bx::isSame, TestClass** >() ); STATIC_REQUIRE( bx::isSame, TestClass* >() ); STATIC_REQUIRE( bx::isSame, TestClass*** >() ); STATIC_REQUIRE( bx::isPointer >() ); STATIC_REQUIRE( bx::isPointer >() ); STATIC_REQUIRE( bx::isPointer >() ); STATIC_REQUIRE( bx::isPointer >() ); } TEST_CASE("type-traits RemovePointerT", "") { STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass* >() ); STATIC_REQUIRE( bx::isSame>, TestClass >() ); STATIC_REQUIRE(!bx::isPointer >() ); STATIC_REQUIRE(!bx::isPointer >() ); STATIC_REQUIRE( bx::isPointer >() ); STATIC_REQUIRE(!bx::isPointer> >() ); } TEST_CASE("type-traits AddConstT", "") { STATIC_REQUIRE( bx::isSame, const TestClass >() ); STATIC_REQUIRE( bx::isSame, const TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass* const >() ); STATIC_REQUIRE( bx::isSame, TestClass* const volatile >() ); } TEST_CASE("type-traits RemoveConstT", "") { STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, volatile TestClass >() ); STATIC_REQUIRE(!bx::isSame, volatile TestClass*>() ); STATIC_REQUIRE( bx::isSame, TestClass* volatile>() ); } TEST_CASE("type-traits AddVolatileT", "") { STATIC_REQUIRE( bx::isSame, volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass* volatile >() ); STATIC_REQUIRE( bx::isSame, TestClass* const volatile >() ); } TEST_CASE("type-traits RemoveVolatileT", "") { STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, const TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, const TestClass >() ); STATIC_REQUIRE(!bx::isSame, const TestClass* >() ); STATIC_REQUIRE( bx::isSame, TestClass* const >() ); } TEST_CASE("type-traits AddCvT", "") { STATIC_REQUIRE( bx::isSame, const volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass >() ); STATIC_REQUIRE( bx::isSame, const volatile TestClass* const volatile >() ); STATIC_REQUIRE( bx::isSame, TestClass* const volatile >() ); } TEST_CASE("type-traits RemoveCvT", "") { STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE( bx::isSame, TestClass >() ); STATIC_REQUIRE(!bx::isSame, TestClass* >() ); STATIC_REQUIRE( bx::isSame, TestClass* >() ); } TEST_CASE("type-traits isTriviallyCopyable", "") { STATIC_REQUIRE( bx::isTriviallyCopyable() ); STATIC_REQUIRE( bx::isTriviallyCopyable() ); STATIC_REQUIRE(!bx::isTriviallyCopyable() ); STATIC_REQUIRE( bx::isTriviallyCopyable() ); STATIC_REQUIRE( bx::isTriviallyCopyable() ); STATIC_REQUIRE(!bx::isTriviallyCopyable() ); } TEST_CASE("type-traits isTriviallyConstructible", "") { STATIC_REQUIRE( bx::isTriviallyConstructible() ); STATIC_REQUIRE( bx::isTriviallyConstructible() ); STATIC_REQUIRE(!bx::isTriviallyConstructible() ); STATIC_REQUIRE(!bx::isTriviallyConstructible() ); STATIC_REQUIRE( bx::isTriviallyConstructible() ); STATIC_REQUIRE(!bx::isTriviallyConstructible() ); } TEST_CASE("type-traits isTriviallyDestructible", "") { STATIC_REQUIRE( bx::isTriviallyDestructible() ); STATIC_REQUIRE( bx::isTriviallyDestructible() ); STATIC_REQUIRE( bx::isTriviallyDestructible() ); STATIC_REQUIRE( bx::isTriviallyDestructible() ); STATIC_REQUIRE( bx::isTriviallyDestructible() ); STATIC_REQUIRE(!bx::isTriviallyDestructible() ); } TEST_CASE("type-traits isSigned", "") { STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE(!bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); STATIC_REQUIRE( bx::isSigned() ); } TEST_CASE("type-traits isUnsigned", "") { STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE( bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); STATIC_REQUIRE(!bx::isUnsigned() ); } TEST_CASE("type-traits isInteger", "") { STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE( bx::isInteger() ); STATIC_REQUIRE(!bx::isInteger() ); STATIC_REQUIRE(!bx::isInteger() ); STATIC_REQUIRE(!bx::isInteger() ); STATIC_REQUIRE(!bx::isInteger() ); STATIC_REQUIRE(!bx::isInteger() ); STATIC_REQUIRE(!bx::isInteger() ); STATIC_REQUIRE(!bx::isInteger() ); STATIC_REQUIRE(!bx::isInteger() ); } TEST_CASE("type-traits isFloatingPoint", "") { STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE( bx::isFloatingPoint() ); STATIC_REQUIRE( bx::isFloatingPoint() ); STATIC_REQUIRE( bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); STATIC_REQUIRE(!bx::isFloatingPoint() ); } TEST_CASE("type-traits isArithmetic", "") { STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE( bx::isArithmetic() ); STATIC_REQUIRE(!bx::isArithmetic() ); STATIC_REQUIRE(!bx::isArithmetic() ); STATIC_REQUIRE(!bx::isArithmetic() ); STATIC_REQUIRE(!bx::isArithmetic() ); STATIC_REQUIRE(!bx::isArithmetic() ); } TEST_CASE("type-traits isBoundedArray", "") { STATIC_REQUIRE(!bx::isBoundedArray() ); STATIC_REQUIRE(!bx::isBoundedArray() ); STATIC_REQUIRE( bx::isBoundedArray() ); STATIC_REQUIRE(!bx::isBoundedArray() ); STATIC_REQUIRE(!bx::isBoundedArray() ); STATIC_REQUIRE(!bx::isBoundedArray() ); STATIC_REQUIRE( bx::isBoundedArray() ); } TEST_CASE("type-traits isUnboundedArray", "") { STATIC_REQUIRE(!bx::isUnboundedArray() ); STATIC_REQUIRE( bx::isUnboundedArray() ); STATIC_REQUIRE(!bx::isUnboundedArray() ); STATIC_REQUIRE(!bx::isUnboundedArray() ); STATIC_REQUIRE(!bx::isUnboundedArray() ); STATIC_REQUIRE( bx::isUnboundedArray() ); STATIC_REQUIRE(!bx::isUnboundedArray() ); } TEST_CASE("type-traits isArray", "") { STATIC_REQUIRE(!bx::isArray() ); STATIC_REQUIRE( bx::isArray() ); STATIC_REQUIRE( bx::isArray() ); STATIC_REQUIRE(!bx::isArray() ); STATIC_REQUIRE(!bx::isArray() ); STATIC_REQUIRE( bx::isArray() ); STATIC_REQUIRE( bx::isArray() ); STATIC_REQUIRE( bx::isArray() ); } TEST_CASE("type-traits isEnum", "") { STATIC_REQUIRE(!bx::isEnum() ); STATIC_REQUIRE(!bx::isEnum() ); STATIC_REQUIRE(!bx::isEnum() ); STATIC_REQUIRE(!bx::isEnum() ); STATIC_REQUIRE(!bx::isEnum() ); STATIC_REQUIRE( bx::isEnum() ); STATIC_REQUIRE( bx::isEnum() ); } TEST_CASE("type-traits isUnion", "") { STATIC_REQUIRE(!bx::isUnion() ); STATIC_REQUIRE( bx::isUnion() ); STATIC_REQUIRE( bx::isUnion() ); STATIC_REQUIRE(!bx::isUnion() ); STATIC_REQUIRE(!bx::isUnion() ); STATIC_REQUIRE(!bx::isUnion() ); STATIC_REQUIRE(!bx::isUnion() ); } TEST_CASE("type-traits isClass", "") { STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE( bx::isClass() ); STATIC_REQUIRE(!bx::isClass() ); STATIC_REQUIRE(!bx::isClass() ); STATIC_REQUIRE(!bx::isClass() ); } TEST_CASE("type-traits isFinal", "") { STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE( bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); STATIC_REQUIRE(!bx::isFinal() ); } TEST_CASE("type-traits isEmpty", "") { STATIC_REQUIRE( bx::isEmpty() ); STATIC_REQUIRE( bx::isEmpty() ); STATIC_REQUIRE( bx::isEmpty() ); STATIC_REQUIRE( bx::isEmpty() ); STATIC_REQUIRE( bx::isEmpty() ); STATIC_REQUIRE(!bx::isEmpty() ); STATIC_REQUIRE(!bx::isEmpty() ); STATIC_REQUIRE(!bx::isEmpty() ); STATIC_REQUIRE(!bx::isEmpty() ); STATIC_REQUIRE(!bx::isEmpty() ); STATIC_REQUIRE(!bx::isEmpty() ); STATIC_REQUIRE(!bx::isEmpty() ); } TEST_CASE("type-traits isStandardLayout", "") { STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE(!bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE(!bx::isStandardLayout() ); STATIC_REQUIRE(!bx::isStandardLayout() ); STATIC_REQUIRE(!bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); STATIC_REQUIRE( bx::isStandardLayout() ); } TEST_CASE("type-traits isTrivial", "") { STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE(!bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE(!bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE(!bx::isTrivial() ); STATIC_REQUIRE(!bx::isTrivial() ); STATIC_REQUIRE(!bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); STATIC_REQUIRE( bx::isTrivial() ); } TEST_CASE("type-traits isPod", "") { STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE(!bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE(!bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE(!bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE(!bx::isPod() ); STATIC_REQUIRE(!bx::isPod() ); STATIC_REQUIRE(!bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); STATIC_REQUIRE( bx::isPod() ); } TEST_CASE("type-traits isPolymorphic", "") { STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE( bx::isPolymorphic() ); STATIC_REQUIRE( bx::isPolymorphic() ); STATIC_REQUIRE( bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE( bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); STATIC_REQUIRE(!bx::isPolymorphic() ); } TEST_CASE("type-traits isDestructorVirtual", "") { STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE( bx::isDestructorVirtual() ); STATIC_REQUIRE( bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE( bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); STATIC_REQUIRE(!bx::isDestructorVirtual() ); } TEST_CASE("type-traits isBaseOf", "") { STATIC_REQUIRE( bx::isBaseOf() ); STATIC_REQUIRE( bx::isBaseOf() ); STATIC_REQUIRE( bx::isBaseOf() ); STATIC_REQUIRE(!bx::isBaseOf() ); STATIC_REQUIRE(!bx::isBaseOf() ); STATIC_REQUIRE(!bx::isBaseOf() ); STATIC_REQUIRE(!bx::isBaseOf() ); } TEST_CASE("type-traits isAggregate", "") { STATIC_REQUIRE( bx::isAggregate() ); STATIC_REQUIRE( bx::isAggregate() ); STATIC_REQUIRE(!bx::isAggregate() ); STATIC_REQUIRE( bx::isAggregate() ); STATIC_REQUIRE(!bx::isAggregate() ); STATIC_REQUIRE( bx::isAggregate() ); #if __cplusplus < BX_LANGUAGE_CPP20 STATIC_REQUIRE( bx::isAggregate() ); #else STATIC_REQUIRE(!bx::isAggregate() ); #endif STATIC_REQUIRE( bx::isAggregate() ); STATIC_REQUIRE(!bx::isAggregate() ); STATIC_REQUIRE(!bx::isAggregate() ); STATIC_REQUIRE(!bx::isAggregate() ); #if __cplusplus < BX_LANGUAGE_CPP17 STATIC_REQUIRE(!bx::isAggregate() ); STATIC_REQUIRE(!bx::isAggregate() ); #else STATIC_REQUIRE( bx::isAggregate() ); STATIC_REQUIRE( bx::isAggregate() ); #endif STATIC_REQUIRE(!bx::isAggregate() ); STATIC_REQUIRE( bx::isAggregate() ); STATIC_REQUIRE( bx::isAggregate() ); STATIC_REQUIRE( bx::isAggregate() ); STATIC_REQUIRE( bx::isAggregate() ); }