This commit is contained in:
@@ -144,35 +144,35 @@ WpTestFuncResult test_cpath_dirup(void) {
|
||||
wpStr8Format(&tmp, "%c", WP_PATH_SEP);
|
||||
wpStr8Format(&expected, "%c", WP_PATH_SEP);
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 3);
|
||||
output = wpCpathDirUp(&arena, &tmp, 3);
|
||||
result = output != NULL && wpStr8Equal(output, &expected);
|
||||
|
||||
// CASE 2
|
||||
wpStr8Format(&tmp, "%chome%cabdelrahman%cDocuments", WP_PATH_SEP, WP_PATH_SEP, WP_PATH_SEP);
|
||||
wpStr8Format(&expected, "%c", WP_PATH_SEP);
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 3);
|
||||
output = wpCpathDirUp(&arena, &tmp, 3);
|
||||
result = result && output != NULL && wpStr8Equal(output, &expected);
|
||||
|
||||
// CASE 3
|
||||
wpStr8Format(&tmp, "home%cabdelrahman%cDocuments", WP_PATH_SEP, WP_PATH_SEP);
|
||||
wpStr8CopyCstrCapped(&expected, ".");
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 3);
|
||||
output = wpCpathDirUp(&arena, &tmp, 3);
|
||||
result = result && output != NULL && wpStr8Equal(output, &expected);
|
||||
|
||||
// CASE 4
|
||||
wpStr8Format(&tmp, "%chome%cabdelrahman%cDocuments", WP_PATH_SEP, WP_PATH_SEP, WP_PATH_SEP);
|
||||
wpStr8Format(&expected, "%chome", WP_PATH_SEP);
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 2);
|
||||
output = wpCpathDirUp(&arena, &tmp, 2);
|
||||
result = result && output != NULL && wpStr8Equal(output, &expected);
|
||||
|
||||
// CASE 5
|
||||
wpStr8Format(&tmp, "home%cabdelrahman%cDocuments", WP_PATH_SEP, WP_PATH_SEP);
|
||||
wpStr8CopyCstrCapped(&expected, "home");
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 2);
|
||||
output = wpCpathDirUp(&arena, &tmp, 2);
|
||||
result = result && output != NULL && wpStr8Equal(output, &expected);
|
||||
|
||||
wpMemArenaAllocatorDestroy(&arena);
|
||||
|
||||
@@ -164,35 +164,35 @@ WpTestFuncResult test_cpath_dirup(void) {
|
||||
wpStr8Format(&tmp, "%c", WP_PATH_SEP);
|
||||
wpStr8Format(&expected, "%c", WP_PATH_SEP);
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 3);
|
||||
output = wpCpathDirUp(&arena, &tmp, 3);
|
||||
result = output != nullptr && wpStr8Equal(output, &expected);
|
||||
|
||||
// CASE 2
|
||||
wpStr8Format(&tmp, "%chome%cabdelrahman%cDocuments", WP_PATH_SEP, WP_PATH_SEP, WP_PATH_SEP);
|
||||
wpStr8Format(&expected, "%c", WP_PATH_SEP);
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 3);
|
||||
output = wpCpathDirUp(&arena, &tmp, 3);
|
||||
result = result && output != nullptr && wpStr8Equal(output, &expected);
|
||||
|
||||
// CASE 3
|
||||
wpStr8Format(&tmp, "home%cabdelrahman%cDocuments", WP_PATH_SEP, WP_PATH_SEP);
|
||||
wpStr8CopyCstrCapped(&expected, ".");
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 3);
|
||||
output = wpCpathDirUp(&arena, &tmp, 3);
|
||||
result = result && output != nullptr && wpStr8Equal(output, &expected);
|
||||
|
||||
// CASE 4
|
||||
wpStr8Format(&tmp, "%chome%cabdelrahman%cDocuments", WP_PATH_SEP, WP_PATH_SEP, WP_PATH_SEP);
|
||||
wpStr8Format(&expected, "%chome", WP_PATH_SEP);
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 2);
|
||||
output = wpCpathDirUp(&arena, &tmp, 2);
|
||||
result = result && output != nullptr && wpStr8Equal(output, &expected);
|
||||
|
||||
// CASE 5
|
||||
wpStr8Format(&tmp, "home%cabdelrahman%cDocuments", WP_PATH_SEP, WP_PATH_SEP);
|
||||
wpStr8CopyCstrCapped(&expected, "home");
|
||||
|
||||
output = wpCpathDirup(&arena, &tmp, 2);
|
||||
output = wpCpathDirUp(&arena, &tmp, 2);
|
||||
result = result && output != nullptr && wpStr8Equal(output, &expected);
|
||||
|
||||
wpMemArenaAllocatorDestroy(&arena);
|
||||
|
||||
Reference in New Issue
Block a user