Commit ed421848 authored by Victor Zverovich's avatar Victor Zverovich

Test passing an array of unknown size as an argument.

parent 1d7bd5d0
......@@ -129,6 +129,8 @@ class TestString {
}
};
extern char array_of_unknown_size[];
TEST(ArrayTest, Ctor) {
Array<char, 123> array;
EXPECT_EQ(0u, array.size());
......@@ -419,6 +421,12 @@ TEST(WriterTest, WriteWideString) {
//fmt::WWriter() << "abc";
}
TEST(WriterTest, WriteArrayOfUnknownSize) {
fmt::Writer w;
w.write("{}", array_of_unknown_size);
EXPECT_EQ(array_of_unknown_size, w.str());
}
TEST(WriterTest, bin) {
using fmt::bin;
EXPECT_EQ("1100101011111110", (Writer() << bin(0xcafe)).str());
......@@ -1523,3 +1531,6 @@ TEST(FormatTest, FormatMessageExample) {
EXPECT_EQ("[42] something happened",
FormatMessage(42, "{} happened", "something"));
}
// This should be at the end of the file to make the array size unknown above.
char array_of_unknown_size[] = "abc";
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment