From b0f13f3778cc5192a4c89fab576b21a9140b3dc5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 30 Aug 2021 19:31:17 +0200 Subject: psxtests/psxconfstr: Fix test case Update #3373. --- testsuites/psxtests/psxconfstr/init.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'testsuites/psxtests/psxconfstr/init.c') diff --git a/testsuites/psxtests/psxconfstr/init.c b/testsuites/psxtests/psxconfstr/init.c index 91eb8dd687..1fb6bcc27c 100644 --- a/testsuites/psxtests/psxconfstr/init.c +++ b/testsuites/psxtests/psxconfstr/init.c @@ -44,39 +44,38 @@ const char rtems_test_name[] = "PSXCONFSTR"; -/* init test function begins */ T_TEST_CASE(confstr) { int r; - char * buf = ""; const char UPE[] = "unsupported programming environment"; + char buf[sizeof(UPE)]; size_t len1; - len1 = strlen(UPE) + 1; - r = confstr(_CS_PATH, buf, sizeof(buf)); - T_quiet_psx_success(r); + + len1 = sizeof(UPE); r = confstr(_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, buf, sizeof(buf)); - T_quiet_eq_int(r, len1); + T_eq_sz(r, len1); r = confstr(_CS_POSIX_V6_LP64_OFF64_LDFLAGS, buf, sizeof(buf)); - T_quiet_eq_int(r, len1); + T_eq_sz(r, len1); r = confstr(_CS_POSIX_V7_ILP32_OFF32_CFLAGS, buf, sizeof(buf)); - T_quiet_eq_int(r, len1); + T_eq_sz(r, len1); r = confstr(_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, buf, sizeof(buf)); - T_quiet_eq_int(r, len1); + T_eq_sz(r, len1); r = confstr(_CS_POSIX_V7_LP64_OFF64_LIBS, buf, sizeof(buf)); - T_quiet_eq_int(r, len1); + T_eq_sz(r, len1); r = confstr(_CS_POSIX_V6_LP64_OFF64_CFLAGS, buf, sizeof(buf)); - T_quiet_eq_int(r, len1); + T_eq_sz(r, len1); + errno = 0; r = confstr(_CS_PATH, buf, sizeof(buf)); - T_quiet_psx_success(r); - + T_eq_sz(r, 0); + T_eq_int(errno, EINVAL); } static rtems_task Init(rtems_task_argument ignored) -- cgit v1.2.3