本文整理汇总了C++中TestRunner::pass方法的典型用法代码示例。如果您正苦于以下问题:C++ TestRunner::pass方法的具体用法?C++ TestRunner::pass怎么用?C++ TestRunner::pass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestRunner
的用法示例。
在下文中一共展示了TestRunner::pass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runHttpNormalizePath
static void runHttpNormalizePath(TestRunner& tr)
{
tr.test("Http normalize path");
char temp[100];
// preserve single slash
{
HttpRequestServicer::normalizePath("/", temp);
assertStrCmp(temp, "/");
}
// preserve single slash
{
HttpRequestServicer::normalizePath("/?", temp);
assertStrCmp(temp, "/?");
}
// no starting slash
{
HttpRequestServicer::normalizePath("a/b/c", temp);
assertStrCmp(temp, "/a/b/c");
}
// extra ending slash
{
HttpRequestServicer::normalizePath("/a/b/c/", temp);
assertStrCmp(temp, "/a/b/c");
}
// no starting slash, extra ending slash
{
HttpRequestServicer::normalizePath("a/b/c/", temp);
assertStrCmp(temp, "/a/b/c");
}
// extra middle slashes
{
HttpRequestServicer::normalizePath("/a//b//c/", temp);
assertStrCmp(temp, "/a/b/c");
}
// crazy
{
HttpRequestServicer::normalizePath("a///b///////c////", temp);
assertStrCmp(temp, "/a/b/c");
}
// crazy
{
HttpRequestServicer::normalizePath("////a///b///////c////", temp);
assertStrCmp(temp, "/a/b/c");
}
// crazy
{
HttpRequestServicer::normalizePath("/a///b///////c////", temp);
assertStrCmp(temp, "/a/b/c");
}
// crazy
{
HttpRequestServicer::normalizePath("woof///moo///////meow////", temp);
assertStrCmp(temp, "/woof/moo/meow");
}
// query
{
HttpRequestServicer::normalizePath("/a//b//c?foo=bar", temp);
assertStrCmp(temp, "/a/b/c?foo=bar");
}
// query
{
HttpRequestServicer::normalizePath("/a//b//c/?foo=bar", temp);
assertStrCmp(temp, "/a/b/c?foo=bar");
}
// query
{
HttpRequestServicer::normalizePath("/a//b//c/?foo=bar&bar2=foo2", temp);
assertStrCmp(temp, "/a/b/c?foo=bar&bar2=foo2");
}
// crazy query
{
HttpRequestServicer::normalizePath("woof///moo///////meow////?foo", temp);
assertStrCmp(temp, "/woof/moo/meow?foo");
}
tr.pass();
}