Commit 51d63aa6 authored by Christoph Haag's avatar Christoph Haag

tests: null terminate too long string and add test for unterminated string

parent 70b9e764
Pipeline #30902 passed with stages
in 44 seconds
......@@ -162,9 +162,16 @@ START_TEST(semantic_path_unit_test) {
char too_long[XR_MAX_PATH_LENGTH + 1];
memset(too_long, 'a', XR_MAX_PATH_LENGTH + 1);
too_long[0] = '/';
too_long[XR_MAX_PATH_LENGTH] = '\0';
ck_assert_int_eq(oxr_xrStringToPath(oxr.instance, too_long, &path),
XR_ERROR_PATH_FORMAT_INVALID);
char unterminated[XR_MAX_PATH_LENGTH];
memset(unterminated, 'a', XR_MAX_PATH_LENGTH);
unterminated[0] = '/';
ck_assert_int_eq(oxr_xrStringToPath(oxr.instance, unterminated, &path),
XR_ERROR_PATH_FORMAT_INVALID);
ck_assert_int_eq(
oxr_xrStringToPath(oxr.instance, "/ascii/0123/-/_/foobar", &path),
XR_SUCCESS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment