diff options
Diffstat (limited to '')
23 files changed, 73 insertions, 98 deletions
diff --git a/testsuites/psxtests/psx08/init.c b/testsuites/psxtests/psx08/init.c index f4af45b5a4..3af6f83d7f 100644 --- a/testsuites/psxtests/psx08/init.c +++ b/testsuites/psxtests/psx08/init.c @@ -4,7 +4,7 @@ * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * - * Copyright (C) 2022 embedded brains GmbH + * Copyright (C) 2022 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c index 0754dbcf30..951953ae98 100644 --- a/testsuites/psxtests/psx13/test.c +++ b/testsuites/psxtests/psx13/test.c @@ -639,6 +639,8 @@ static void FutimensTest( void ) /* EBADF test case */ /* Case: Pass an invalid file descriptor */ + _Timespec_Set_to_zero( &time[0] ); + _Timespec_Set_to_zero( &time[1] ); rv = futimens( -1, time ); rtems_test_assert( rv == -1 ); rtems_test_assert( errno == EBADF ); diff --git a/testsuites/psxtests/psx15/init.c b/testsuites/psxtests/psx15/init.c index e6ade823f7..fff3db01c3 100644 --- a/testsuites/psxtests/psx15/init.c +++ b/testsuites/psxtests/psx15/init.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (c) 2010 embedded brains GmbH. All rights reserved. + * Copyright (c) 2010 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxbarrier01/test.c b/testsuites/psxtests/psxbarrier01/test.c index 3bea278aac..1f3bdb138c 100644 --- a/testsuites/psxtests/psxbarrier01/test.c +++ b/testsuites/psxtests/psxbarrier01/test.c @@ -6,7 +6,7 @@ * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * - * Copyright (c) 2017 embedded brains GmbH + * Copyright (c) 2017 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxchroot01/test.c b/testsuites/psxtests/psxchroot01/test.c index 8270bf5b58..7ac6a80d56 100644 --- a/testsuites/psxtests/psxchroot01/test.c +++ b/testsuites/psxtests/psxchroot01/test.c @@ -5,7 +5,7 @@ * On-Line Applications Research Corporation (OAR). * * Modifications to support reference counting in the file system are - * Copyright (c) 2012 embedded brains GmbH. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxcleanup02/init.c b/testsuites/psxtests/psxcleanup02/init.c index 89ae7f1930..c123a817ea 100644 --- a/testsuites/psxtests/psxcleanup02/init.c +++ b/testsuites/psxtests/psxcleanup02/init.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 embedded brains GmbH. All rights reserved. + * Copyright (c) 2015 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/testsuites/psxtests/psxcleanup02/main.c b/testsuites/psxtests/psxcleanup02/main.c index 071d84c059..a72c30970a 100644 --- a/testsuites/psxtests/psxcleanup02/main.c +++ b/testsuites/psxtests/psxcleanup02/main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 embedded brains GmbH. All rights reserved. + * Copyright (c) 2015 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/testsuites/psxtests/psxclock/init.c b/testsuites/psxtests/psxclock/init.c index 743cfa6d78..eb2f1d130c 100644 --- a/testsuites/psxtests/psxclock/init.c +++ b/testsuites/psxtests/psxclock/init.c @@ -115,7 +115,7 @@ static void test_clock_check( clock_context* ctx, const rtems_interval ticks_per (((ctx->tspec.tv_sec * 1000000000LLU) + ctx->tspec.tv_nsec) / tick_period_nsec) + 1; rtems_test_assert( ctx->result == 0 ); printf( - "clock: %s: sec=%llu nsec=%li ticks=%u expected-ticks=%u\n", + "clock: %s: sec=%" PRIdtime_t" nsec=%li ticks=%u expected-ticks=%u\n", ctx->name, ctx->tspec.tv_sec, ctx->tspec.tv_nsec, ctx->ticks, ticks); rtems_test_assert( ctx->ticks == ticks ); } diff --git a/testsuites/psxtests/psxclockrealtime01/init.c b/testsuites/psxtests/psxclockrealtime01/init.c index 720e7ced52..722a756ebb 100644 --- a/testsuites/psxtests/psxclockrealtime01/init.c +++ b/testsuites/psxtests/psxclockrealtime01/init.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 embedded brains GmbH. All rights reserved. + * Copyright (c) 2017 embedded brains GmbH & Co. KG * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at diff --git a/testsuites/psxtests/psxconfig01/init.c b/testsuites/psxtests/psxconfig01/init.c index 3a0e5b3049..77a96d1c67 100644 --- a/testsuites/psxtests/psxconfig01/init.c +++ b/testsuites/psxtests/psxconfig01/init.c @@ -10,7 +10,7 @@ /* * Copyright (c) 2014. On-Line Applications Research Corporation (OAR). - * Copyright (c) 2011-2014 embedded brains GmbH. All rights reserved. + * Copyright (C) 2011, 2014 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxconfig01/psxconfig01.doc b/testsuites/psxtests/psxconfig01/psxconfig01.doc index 524c8a9994..d8f70bded3 100644 --- a/testsuites/psxtests/psxconfig01/psxconfig01.doc +++ b/testsuites/psxtests/psxconfig01/psxconfig01.doc @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-2-Clause -# Copyright (c) 2011 embedded brains GmbH. +# Copyright (c) 2011 embedded brains GmbH & Co. KG # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxenosys/init.c b/testsuites/psxtests/psxenosys/init.c index 40f83aa0f0..d9a4d835f7 100644 --- a/testsuites/psxtests/psxenosys/init.c +++ b/testsuites/psxtests/psxenosys/init.c @@ -104,9 +104,15 @@ void *POSIX_Init( sc = fork(); check_enosys( sc ); - puts( "pthread_atfork -- ENOSYS" ); + /* + * The behavior of pthread_atfork() in single process environments was + * undefined by POSIX but the fACE Technical Standard required returning + * 0. Before ticket #4713, this did return ENOSYS. Just leaving this test + * case here for convenience. + */ + puts( "pthread_atfork -- 0" ); sc = pthread_atfork( NULL, NULL, NULL ); - check_enosys( sc ); + rtems_test_assert( !sc ); puts( "pthread_getcpuclockid -- ENOSYS" ); sc = pthread_getcpuclockid( 0, NULL ); diff --git a/testsuites/psxtests/psxenosys/psxenosys.scn b/testsuites/psxtests/psxenosys/psxenosys.scn index 1ed64f92e9..9e88acd05a 100644 --- a/testsuites/psxtests/psxenosys/psxenosys.scn +++ b/testsuites/psxtests/psxenosys/psxenosys.scn @@ -9,7 +9,7 @@ execv -- ENOSYS execve -- ENOSYS execvp -- ENOSYS fork -- ENOSYS -pthread_atfork -- ENOSYS +pthread_atfork -- 0 pthread_getcpuclockid -- ENOSYS sched_setparam -- ENOSYS sched_getparam -- ENOSYS diff --git a/testsuites/psxtests/psxftw01/init.c b/testsuites/psxtests/psxftw01/init.c index ee0e40c84a..5bd89928d1 100644 --- a/testsuites/psxtests/psxftw01/init.c +++ b/testsuites/psxtests/psxftw01/init.c @@ -6,7 +6,7 @@ /* * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (C) 2020 Eshan Dhawan, embedded brains GmbH, Joel Sherrill + * Copyright (C) 2020 Eshan Dhawan, embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -66,36 +66,6 @@ void *POSIX_Init (void * argument); static char file_traverse_order[6][20]; static int file_order; -static char buffer[512]; - -static const T_action actions[] = { - T_report_hash_sha256, - T_check_task_context, - T_check_file_descriptors, - T_check_rtems_barriers, - T_check_rtems_extensions, - T_check_rtems_message_queues, - T_check_rtems_partitions, - T_check_rtems_periods, - T_check_rtems_regions, - T_check_rtems_semaphores, - T_check_rtems_tasks, - T_check_rtems_timers, - T_check_posix_keys -}; - -static const T_config config = { - .name = "psxftw01", - .buf = buffer, - .buf_size = sizeof(buffer), - .putchar = rtems_put_char, - .verbosity = T_VERBOSE, - .now = T_now_clock, - .action_count = T_ARRAY_SIZE(actions), - .actions = actions -}; - - static int fn_function (const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf) { @@ -122,9 +92,7 @@ T_TEST_CASE(ftw) TARFILE_SIZE, &rtems_test_printer ); - if (sc != RTEMS_SUCCESSFUL) { - printf ("error: untar failed: %s\n", rtems_status_text (sc)); - } + T_rsc_success( sc ); /* Array with expected file order */ char arr_ftw_depth[5][20] = { "test_file", "test_script", "def", "abc", "home" }; @@ -136,49 +104,31 @@ T_TEST_CASE(ftw) file_order = 0; flags |= FTW_DEPTH; r = nftw( files_path, fn_function, 5, flags ); - - T_quiet_psx_success(r); + T_psx_success( r ); /*comparing the nftw file tree to the expexted file tree traversal */ for (i = 0; i < file_order; i++){ r = strcmp( arr_ftw_depth[i], file_traverse_order[i]); - if (r){ - printf( "Incorrect Order " ); - } - T_quiet_psx_success(r); + T_eq_int( r, 0 ); } /*----------------Test Block 2--------------------*/ flags = 0; file_order = 0; flags |= FTW_PHYS; r = nftw( files_path, fn_function, 5, flags ); - T_quiet_psx_success(r); + T_psx_success(r); /*comparing the nftw file tree to the expected file tree traversal*/ for (i = 0; i < file_order; i++){ r = strcmp( arr_ftw_phys[i], file_traverse_order[i]); - if (r){ - printf( "Incorrect Order " ); - } - T_quiet_psx_success(r); + T_eq_int( r, 0 ); } } void *POSIX_Init (void * argument) { - int exit_code; - - TEST_BEGIN(); - - T_register(); - exit_code = T_main(&config); - if (exit_code == 0) { - TEST_END(); - } - - rtems_test_exit(exit_code); - + rtems_test_run( (rtems_task_argument) argument, TEST_STATE ); } /* NOTICE: the clock driver is explicitly disabled */ diff --git a/testsuites/psxtests/psxglobalcon01/init.cc b/testsuites/psxtests/psxglobalcon01/init.cc index 2ccbba9e34..a61734bcd1 100644 --- a/testsuites/psxtests/psxglobalcon01/init.cc +++ b/testsuites/psxtests/psxglobalcon01/init.cc @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxglobalcon02/init.cc b/testsuites/psxtests/psxglobalcon02/init.cc index 0e530246e0..3d8206261a 100644 --- a/testsuites/psxtests/psxglobalcon02/init.cc +++ b/testsuites/psxtests/psxglobalcon02/init.cc @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxintrcritical01/init.c b/testsuites/psxtests/psxintrcritical01/init.c index deb95da994..27126e31ec 100644 --- a/testsuites/psxtests/psxintrcritical01/init.c +++ b/testsuites/psxtests/psxintrcritical01/init.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2020 embedded brains GmbH & Co. KG * * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). diff --git a/testsuites/psxtests/psxkey07/init.c b/testsuites/psxtests/psxkey07/init.c index 593df739db..ff7b3a0bd0 100644 --- a/testsuites/psxtests/psxkey07/init.c +++ b/testsuites/psxtests/psxkey07/init.c @@ -39,23 +39,25 @@ const char rtems_test_name[] = "PSXKEY 7"; -/* forward declarations to avoid warnings */ -rtems_task Init(rtems_task_argument argument); -rtems_task Test_Thread(rtems_task_argument argument); +#define INITIAL_TASK_COUNT 10 -pthread_key_t Key; -int created_thread_count, setted_thread_count, got_thread_count; -int all_thread_created; -pthread_mutex_t mutex1, mutex2; -pthread_cond_t create_condition_var, set_condition_var; +#define ADDITIONAL_TASK_COUNT 13 -rtems_task Test_Thread(rtems_task_argument argument) +static pthread_key_t Key; +static int created_thread_count, setted_thread_count, got_thread_count; +static int all_thread_created; +static pthread_mutex_t mutex1, mutex2; +static pthread_cond_t create_condition_var, set_condition_var; + +static rtems_task Test_Thread(rtems_task_argument argument) { int sc; int *value_p, *value_p2; value_p = malloc( sizeof( int ) ); rtems_test_assert(value_p != NULL); + + *value_p = 123; sc = pthread_setspecific( Key, value_p ); rtems_test_assert( !sc ); @@ -79,12 +81,13 @@ rtems_task Test_Thread(rtems_task_argument argument) rtems_task_exit(); } -rtems_task Init(rtems_task_argument argument) +static rtems_task Init(rtems_task_argument argument) { rtems_status_code rc; int sc; struct timespec delay_request; - uintptr_t max_free_size = 13 * RTEMS_MINIMUM_STACK_SIZE; + uintptr_t max_free_size = + ADDITIONAL_TASK_COUNT * RTEMS_MINIMUM_STACK_SIZE; void *greedy; all_thread_created = 0; @@ -215,8 +218,10 @@ rtems_task Init(rtems_task_argument argument) #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION -#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited(10) -#define CONFIGURE_MAXIMUM_POSIX_KEYS 1 +#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited(INITIAL_TASK_COUNT) +#define CONFIGURE_MAXIMUM_POSIX_KEYS 1 +#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \ + (INITIAL_TASK_COUNT + ADDITIONAL_TASK_COUNT) #define CONFIGURE_UNIFIED_WORK_AREAS #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/psxtests/psxmount/test.c b/testsuites/psxtests/psxmount/test.c index 9ce68dda59..202baed46c 100644 --- a/testsuites/psxtests/psxmount/test.c +++ b/testsuites/psxtests/psxmount/test.c @@ -5,7 +5,7 @@ * On-Line Applications Research Corporation (OAR). * * Modifications to support reference counting in the file system are - * Copyright (c) 2012 embedded brains GmbH. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxonce01/init.c b/testsuites/psxtests/psxonce01/init.c index dfa0204d62..033b1a02f3 100644 --- a/testsuites/psxtests/psxonce01/init.c +++ b/testsuites/psxtests/psxonce01/init.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2019 embedded brains GmbH + * Copyright (C) 2019 embedded brains GmbH & Co. KG * Copyright (C) 2019 Sebastian Huber * * COPYRIGHT (c) 1989-2009. diff --git a/testsuites/psxtests/psxonce01/psxonce01.doc b/testsuites/psxtests/psxonce01/psxonce01.doc index 7abbd2e037..3ca5d680c7 100644 --- a/testsuites/psxtests/psxonce01/psxonce01.doc +++ b/testsuites/psxtests/psxonce01/psxonce01.doc @@ -3,7 +3,7 @@ # COPYRIGHT (c) 1989-2009. # On-Line Applications Research Corporation (OAR). # Copyright (c) 2013 Annelies Odermann <annelies.odermann@gmail.com> -# Copyright (c) 2014 embedded brains GmbH. +# Copyright (c) 2014 embedded brains GmbH & Co. KG # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/testsuites/psxtests/psxrwlock01/test.c b/testsuites/psxtests/psxrwlock01/test.c index 5767aa7c07..f6954007c0 100644 --- a/testsuites/psxtests/psxrwlock01/test.c +++ b/testsuites/psxtests/psxrwlock01/test.c @@ -454,10 +454,6 @@ int main( status = pthread_rwlock_timedrdlock( NULL, &abstime); rtems_test_assert( status == EINVAL ); - puts( "pthread_rwlock_timedrdlock( &rwlock, NULL) -- EINVAL" ); - status = pthread_rwlock_timedrdlock( &rwlock, NULL); - rtems_test_assert( status == EINVAL ); - puts( "pthread_rwlock_tryrdlock(NULL) -- EINVAL" ); status = pthread_rwlock_tryrdlock(NULL); rtems_test_assert( status == EINVAL ); @@ -470,10 +466,6 @@ int main( status = pthread_rwlock_timedwrlock( NULL, &abstime ); rtems_test_assert( status == EINVAL ); - puts( "pthread_rwlock_timedwrlock( &rwlock, NULL) -- EINVAL" ); - status = pthread_rwlock_timedwrlock( &rwlock, NULL); - rtems_test_assert( status == EINVAL ); - puts( "pthread_rwlock_trywrlock(NULL) -- EINVAL" ); status = pthread_rwlock_trywrlock(NULL); rtems_test_assert( status == EINVAL ); @@ -482,6 +474,26 @@ int main( status = pthread_rwlock_unlock(NULL); rtems_test_assert( status == EINVAL ); + status = pthread_rwlock_init( &rwlock, NULL ); + rtems_test_assert( status == 0 ); + + status = pthread_rwlock_wrlock( &rwlock ); + rtems_test_assert( status == 0 ); + + puts( "pthread_rwlock_timedrdlock( &rwlock, NULL) -- EINVAL" ); + status = pthread_rwlock_timedrdlock( &rwlock, NULL); + rtems_test_assert( status == EINVAL ); + + puts( "pthread_rwlock_timedwrlock( &rwlock, NULL) -- EINVAL" ); + status = pthread_rwlock_timedwrlock( &rwlock, NULL); + rtems_test_assert( status == EINVAL ); + + status = pthread_rwlock_unlock( &rwlock ); + rtems_test_assert( status == 0 ); + + status = pthread_rwlock_destroy( &rwlock ); + rtems_test_assert( status == 0 ); + /*************** BAD ID CHECK *****************/ /* make a valid abstime */ puts( "clock_gettime(CLOCK_REALTIME, &abstime) -- OK" ); diff --git a/testsuites/psxtests/psxthreadname01/init.c b/testsuites/psxtests/psxthreadname01/init.c index 3183272ce8..c5d5cef604 100644 --- a/testsuites/psxtests/psxthreadname01/init.c +++ b/testsuites/psxtests/psxthreadname01/init.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (c) 2017 embedded brains GmbH. All rights reserved. + * Copyright (c) 2017 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions |