Skip to content

Commit 07ceb14

Browse files
committed
Adding missing test cpp to streams 140 test project, and replacing json test macro with a template function.
1 parent 4a82e11 commit 07ceb14

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

Release/tests/functional/json/parsing_tests.cpp

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,6 @@ do { \
6868
} \
6969
} while (false)
7070

71-
72-
#define JSON_TEST_HELPER(jsonData) \
73-
{ \
74-
std::error_code err; \
75-
auto parsedObject = web::json::value::parse(jsonData, err); \
76-
\
77-
VERIFY_IS_TRUE(err.value() == 0); \
78-
VERIFY_IS_TRUE(!parsedObject.is_null()); \
79-
}
80-
8171
SUITE(parsing_tests)
8272
{
8373

@@ -623,16 +613,25 @@ TEST(non_default_locale)
623613
}
624614
}
625615

616+
template <typename T>
617+
void error_code_helper(T &jsonData)
618+
{
619+
std::error_code err;
620+
auto parsedObject = web::json::value::parse(jsonData, err);
621+
VERIFY_IS_TRUE(err.value() == 0);
622+
VERIFY_IS_TRUE(!parsedObject.is_null());
623+
}
624+
626625
TEST(parse_overload_success)
627626
{
628627
std::error_code err;
629628
utility::string_t valueStr(U("\"JSONString\""));
630629
utility::string_t arrStr(U("[true,false,-1.55,5,null,{\"abc\":5555}]"));
631630
utility::string_t objStr(U("{\"k\":3, \"j\":2, \"i\":1}"));
632631

633-
JSON_TEST_HELPER(valueStr);
634-
JSON_TEST_HELPER(arrStr);
635-
JSON_TEST_HELPER(objStr);
632+
error_code_helper(valueStr);
633+
error_code_helper(arrStr);
634+
error_code_helper(objStr);
636635

637636
utility::stringstream_t valueStringStream;
638637
utility::stringstream_t arrayStringStream;
@@ -642,24 +641,24 @@ TEST(parse_overload_success)
642641
arrayStringStream << arrStr;
643642
objStringStream << objStr;
644643

645-
JSON_TEST_HELPER(valueStringStream.str());
646-
JSON_TEST_HELPER(arrayStringStream.str());
647-
JSON_TEST_HELPER(objStringStream.str());
644+
error_code_helper(valueStringStream);
645+
error_code_helper(arrayStringStream);
646+
error_code_helper(objStringStream);
648647

649648
#ifdef _MS_WINDOWS
650649
std::wstringbuf buf;
651650

652651
buf.sputn(valueStr.c_str(), valueStr.size());
653652
std::wistream valStream(&buf);
654-
JSON_TEST_HELPER(valStream);
653+
error_code_helper(valStream);
655654

656655
buf.sputn(arrStr.c_str(), arrStr.size());
657656
std::wistream arrStream(&buf);
658-
JSON_TEST_HELPER(arrStream);
657+
error_code_helper(arrStream);
659658

660659
buf.sputn(objStr.c_str(), objStr.size());
661660
std::wistream objStream(&buf);
662-
JSON_TEST_HELPER(objStream);
661+
error_code_helper(objStream);
663662
#endif
664663
}
665664

Release/tests/functional/pplx/pplx_test/vs14/pplx140_test.vcxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
<SubSystem>Windows</SubSystem>
106106
<GenerateDebugInformation>true</GenerateDebugInformation>
107107
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
108-
<Profile>true</Profile>
109108
</Link>
110109
</ItemDefinitionGroup>
111110
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
@@ -120,7 +119,6 @@
120119
<SubSystem>Windows</SubSystem>
121120
<GenerateDebugInformation>true</GenerateDebugInformation>
122121
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
123-
<Profile>true</Profile>
124122
</Link>
125123
</ItemDefinitionGroup>
126124
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

Release/tests/functional/streams/vs14/streams140_test.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
</Link>
186186
</ItemDefinitionGroup>
187187
<ItemGroup>
188+
<ClCompile Include="..\CppSparseFile.cpp" />
188189
<ClCompile Include="..\fstreambuf_tests.cpp" />
189190
<ClCompile Include="..\ostream_tests.cpp" />
190191
<ClCompile Include="..\stdstream_tests.cpp" />

0 commit comments

Comments
 (0)