示例#1
0
 void RunTest(const uint8_t *in, size_t inlen,
              const uint8_t *out = NULL, size_t outlen = 0)
 {
     TextBuf input(in, inlen);
     if (out == NULL) {
         out = in;
         outlen = inlen;
     }
     TextBuf expected(out, outlen);
     RunTestInplaceEx(input, expected);
     RunTestCowEx(input, expected);
 }
示例#2
0
TEST_P(TestEscapeJSONCStrings, simple_pairs) {
    TestEscapeJSONCStrings_t p = GetParam();
    TextBuf input(p.input);
    TextBuf expected(p.expected);

    RunTestInplaceNul(input, expected);
    RunTestInplaceEx(input, expected);
    RunTestCowNul(input, expected);
    RunTestCowEx(input, expected);
    RunTestCopyNul(input, expected);
    RunTestCopyEx(input, expected);
    RunTestBuf(p.input, p.expected, strlen(p.expected)+1, IB_OK);
}