From 6ea14f0dd23cb46031a40cdbf13397ec97bd3586 Mon Sep 17 00:00:00 2001 From: Dean Moldovan Date: Mon, 9 Nov 2015 00:10:42 +0100 Subject: [PATCH] Test that arrays of Value/Arg and MakeValue/MakeArg are equivalent ArgArray construction depends on this behavior. Note that this is only relevant in the C++11 code path. --- test/util-test.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/util-test.cc b/test/util-test.cc index fec7b37c..2f1c802a 100644 --- a/test/util-test.cc +++ b/test/util-test.cc @@ -114,6 +114,20 @@ TEST(BufferTest, Nonmoveable) { EXPECT_FALSE(std::is_move_constructible >::value); EXPECT_FALSE(std::is_move_assignable >::value); } + +TEST(ArgArrayTest, ValueTraits) { + typedef fmt::internal::MakeValue< fmt::BasicFormatter > MakeValue; + EXPECT_TRUE(std::is_pod::value); + EXPECT_TRUE(std::is_standard_layout::value); + EXPECT_EQ(sizeof(Value[2]), sizeof(MakeValue[2])); +} + +TEST(ArgArrayTest, ArgTraits) { + typedef fmt::internal::MakeArg< fmt::BasicFormatter > MakeArg; + EXPECT_TRUE(std::is_pod::value); + EXPECT_TRUE(std::is_standard_layout::value); + EXPECT_EQ(sizeof(Arg[2]), sizeof(MakeArg[2])); +} #endif // A test buffer with a dummy grow method.