MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / testEscapingHelper

Function testEscapingHelper

3rd/uriparser/test/test.cpp:797–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795
796namespace {
797 bool testEscapingHelper(const wchar_t * in, const wchar_t * expectedOut,
798 bool spaceToPlus = false, bool normalizeBreaks = false) {
799 wchar_t * const buffer = new wchar_t[(normalizeBreaks ? 6 : 3)
800 * wcslen(in) + 1];
801 if (uriEscapeW(in, buffer, spaceToPlus, normalizeBreaks)
802 != buffer + wcslen(expectedOut)) {
803 delete [] buffer;
804 return false;
805 }
806
807 const bool equal = !wcscmp(buffer, expectedOut);
808 delete [] buffer;
809 return equal;
810 }
811} // namespace
812
813TEST(UriSuite, TestEscaping) {

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected