Fixes initializer_list casting bug in PrettyPrint tests.
This commit is contained in:
@@ -54,7 +54,7 @@ using std::wstring;
|
||||
|
||||
TestResults test_EscapeForPrintingWithAConstCharPointer() {
|
||||
TestResults results;
|
||||
auto escape_const_char_pointer = [](const char* value) -> string { return EscapeForPrinting(value); };
|
||||
auto escape_const_char_pointer = [](const char *value) -> string { return EscapeForPrinting(value); };
|
||||
results += execute_suite(make_test_suite(
|
||||
"CPPUtils::EscapeForPrinting(const char*)",
|
||||
escape_const_char_pointer,
|
||||
@@ -73,7 +73,7 @@ TestResults test_EscapeForPrintingWithAConstCharPointer() {
|
||||
|
||||
TestResults test_EscapeForPrintingWithAString() {
|
||||
TestResults results;
|
||||
auto escape_string = [](const string& value) -> string { return EscapeForPrinting(value); };
|
||||
auto escape_string = [](const string &value) -> string { return EscapeForPrinting(value); };
|
||||
results += execute_suite(make_test_suite(
|
||||
"CPPUtils::EscapeForPrinting(const std::string&)",
|
||||
escape_string,
|
||||
@@ -91,7 +91,7 @@ TestResults test_EscapeForPrintingWithAString() {
|
||||
}
|
||||
|
||||
TestResults test_EscapeForPrintingWithAStringView() {
|
||||
auto escape_string_view = [](const string_view& value) -> string { return EscapeForPrinting(value); };
|
||||
auto escape_string_view = [](const string_view &value) -> string { return EscapeForPrinting(value); };
|
||||
return execute_suite(make_test_suite(
|
||||
"CPPUtils::EscapeForPrinting(const std::string_view&)",
|
||||
escape_string_view,
|
||||
@@ -108,7 +108,7 @@ TestResults test_EscapeForPrintingWithAStringView() {
|
||||
}
|
||||
|
||||
TestResults test_PrettyPrintWithAConstCharPointer() {
|
||||
auto pretty_print = [](const char* value) -> string {
|
||||
auto pretty_print = [](const char *value) -> string {
|
||||
ostringstream os;
|
||||
PrettyPrint(os, value);
|
||||
return os.str();
|
||||
@@ -123,7 +123,7 @@ TestResults test_PrettyPrintWithAConstCharPointer() {
|
||||
}
|
||||
|
||||
TestResults test_PrettyPrintWithAString() {
|
||||
auto pretty_print = [](const string& value) -> string {
|
||||
auto pretty_print = [](const string &value) -> string {
|
||||
ostringstream os;
|
||||
PrettyPrint(os, value);
|
||||
return os.str();
|
||||
@@ -138,7 +138,7 @@ TestResults test_PrettyPrintWithAString() {
|
||||
}
|
||||
|
||||
TestResults test_PrettyPrintWithAStringView() {
|
||||
auto pretty_print = [](const std::string_view& value) -> string {
|
||||
auto pretty_print = [](const std::string_view &value) -> string {
|
||||
ostringstream os;
|
||||
PrettyPrint(os, value);
|
||||
return os.str();
|
||||
@@ -182,12 +182,13 @@ TestResults test_PrettyPrintWithATuple() {
|
||||
TestResults test_PrettyPrintWithAnInitializerList() {
|
||||
auto pretty_print = [](int i) {
|
||||
ostringstream os;
|
||||
std::initializer_list<string> empty_initializer_list = {};
|
||||
switch (i) {
|
||||
case 1:
|
||||
PrettyPrint(os, {"one", "two", "three"});
|
||||
break;
|
||||
case 2:
|
||||
PrettyPrint(os, (std::initializer_list<string>){});
|
||||
PrettyPrint(os, empty_initializer_list);
|
||||
break;
|
||||
case 3:
|
||||
PrettyPrint(os, {1, 2, 3});
|
||||
@@ -288,7 +289,7 @@ TestResults test_PrettyPrintWithSimpleTypes() {
|
||||
make_test("should print 3.14 for a float", (string) "3.14", make_tuple(3.14f)),
|
||||
}));
|
||||
|
||||
auto pretty_print_string = [](const string& value) -> string {
|
||||
auto pretty_print_string = [](const string &value) -> string {
|
||||
ostringstream os;
|
||||
PrettyPrint(os, value);
|
||||
return os.str();
|
||||
@@ -332,7 +333,7 @@ TestResults test_PrettyPrintWithAPair() {
|
||||
}
|
||||
|
||||
TestResults test_PrettyPrintWithSeparatorWithAConstCharPointer() {
|
||||
auto pretty_print = [](const char* separator, int id) -> string {
|
||||
auto pretty_print = [](const char *separator, int id) -> string {
|
||||
ostringstream os;
|
||||
switch (id) {
|
||||
case 1:
|
||||
@@ -362,7 +363,7 @@ TestResults test_PrettyPrintWithSeparatorWithAConstCharPointer() {
|
||||
}
|
||||
|
||||
TestResults test_PrettyPrintWithSeparatorWithAString() {
|
||||
auto pretty_print = [](const string& separator, int id) -> string {
|
||||
auto pretty_print = [](const string &separator, int id) -> string {
|
||||
ostringstream os;
|
||||
switch (id) {
|
||||
case 1:
|
||||
@@ -392,7 +393,7 @@ TestResults test_PrettyPrintWithSeparatorWithAString() {
|
||||
}
|
||||
|
||||
TestResults test_PrettyPrintWithSeparatorWithAStringView() {
|
||||
auto pretty_print = [](const string_view& separator, int id) -> string {
|
||||
auto pretty_print = [](const string_view &separator, int id) -> string {
|
||||
ostringstream os;
|
||||
switch (id) {
|
||||
case 1:
|
||||
@@ -422,7 +423,7 @@ TestResults test_PrettyPrintWithSeparatorWithAStringView() {
|
||||
}));
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int main(int argc, char *argv[]) {
|
||||
setlocale(LC_ALL, "");
|
||||
TestResults results;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user