5TEST_F(Common_test, Test_StructSizeAlign16Bytes)
7 EXPECT_EQ(0,
sizeof(::Camera) % 16);
8 EXPECT_EQ(0,
sizeof(::Object) % 16);
12TEST_F(Common_test, Test_Destructor)
14 EXPECT_TRUE(::std::has_virtual_destructor<Tested_t>::value);
15 EXPECT_TRUE(::std::is_nothrow_destructible<Tested_t>::value);
19TEST_F(Common_test, Test_RegisterIntoFactory)
21 using namespace ::alicorn::modules::patterns;
24 const ::covellite::api::renderer::SettingsData & Data = oData;
26 auto pExample = factory::make_unique<ITested_t>(ImplClassName, Data);
27 EXPECT_NO_THROW(
dynamic_cast<Tested_t &
>(*pExample));
31TEST_F(Common_test, Test_State_AlphaTest)
33 Tested_t Example{ Data_t{} };
34 ITested_t & IExample = Example;
36 auto itCreator = IExample.GetCreators().find(uT(
"State"));
37 ASSERT_NE(IExample.GetCreators().end(), itCreator);
40 const auto pState = Component_t::Make(
42 { uT(
"kind"), uT(
"AlphaTest") },
45 EXPECT_EQ(
nullptr, itCreator->second(pState));
49 const auto Value = 1904271913.0f;
51 const auto pState = Component_t::Make(
53 { uT(
"kind"), uT(
"AlphaTest") },
54 { uT(
"discard"), Value },
57 EXPECT_EQ(
nullptr, itCreator->second(pState));
62TEST_F(Common_test, Test_Transform_UnknownKind)
64 const Tested_t oExample{ Data_t{} };
65 const ITested_t & IExample = oExample;
67 auto itCreator = IExample.GetCreators().find(uT(
"Transform"));
68 ASSERT_NE(IExample.GetCreators().end(), itCreator);
70 const auto pComponent = Component_t::Make(
72 { uT(
"kind"), uT(
"Unknow1908061947") },
75 EXPECT_THROW(itCreator->second(pComponent), ::std::exception);
79TEST_F(Common_test, Test_Buffer_Constant_User_EmptyMapper)
81 using BufferMapper_t = ::covellite::api::cbBufferMap_t<void>;
83 const Tested_t oExample{ Data_t{} };
84 const ITested_t & IExample = oExample;
86 auto itCreator = IExample.GetCreators().find(uT(
"Buffer"));
87 ASSERT_NE(IExample.GetCreators().end(), itCreator);
92 const auto pComponent1 = Component_t::Make(
94 { uT(
"mapper"), BufferMapper_t{ } },
97 EXPECT_THROW(itCreator->second(pComponent1), ::std::exception);
99 const auto pComponent2 = Component_t::Make(
101 { uT(
"mapper"), BufferMapper_t{
nullptr } },
104 EXPECT_THROW(itCreator->second(pComponent2), ::std::exception);
108TEST_F(Common_test, Test_Buffer_Constant_User_EmptySize)
110 using BufferMapper_t = ::covellite::api::cbBufferMap_t<void>;
112 const Tested_t oExample{ Data_t{} };
113 const ITested_t & IExample = oExample;
115 auto itCreator = IExample.GetCreators().find(uT(
"Buffer"));
116 ASSERT_NE(IExample.GetCreators().end(), itCreator);
118 const auto pComponent = Component_t::Make(
120 { uT(
"mapper"), BufferMapper_t{ [](
void *) {
return false; } } },
123 EXPECT_THROW(itCreator->second(pComponent), ::std::exception);