diff options
Diffstat (limited to '')
-rw-r--r-- | testsuites/psxtests/psxtime/main.c | 25 | ||||
-rw-r--r-- | testsuites/psxtests/psxtime/psxtime.doc | 2 | ||||
-rw-r--r-- | testsuites/psxtests/psxtime/test.c | 35 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimer01/psxtimer.c | 34 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimer01/system.h | 25 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimer02/psxtimer.c | 34 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimer02/system.h | 25 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimer_face01/psxtimer.c | 123 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimer_face01/psxtimer_face01.doc | 49 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimer_face01/psxtimer_face01.scn | 6 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimes01/init.c | 25 | ||||
-rw-r--r-- | testsuites/psxtests/psxtimes01/psxtimes01.doc | 25 |
12 files changed, 372 insertions, 36 deletions
diff --git a/testsuites/psxtests/psxtime/main.c b/testsuites/psxtests/psxtime/main.c index c45efbb019..28c29e5846 100644 --- a/testsuites/psxtests/psxtime/main.c +++ b/testsuites/psxtests/psxtime/main.c @@ -1,12 +1,31 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Simple RTEMS startup to call main * * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H diff --git a/testsuites/psxtests/psxtime/psxtime.doc b/testsuites/psxtests/psxtime/psxtime.doc index ec46f9293b..88f416713d 100644 --- a/testsuites/psxtests/psxtime/psxtime.doc +++ b/testsuites/psxtests/psxtime/psxtime.doc @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: BSD-2-Clause + # testsuites/psxtests/psxtime/psxtime.doc
# Copyright (c) 2013 Shaily Sangwan <shailysangwan@gmail.com>.
#
diff --git a/testsuites/psxtests/psxtime/test.c b/testsuites/psxtests/psxtime/test.c index d9f5537152..796d3d5d35 100644 --- a/testsuites/psxtests/psxtime/test.c +++ b/testsuites/psxtests/psxtime/test.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -11,9 +13,26 @@ * COPYRIGHT (c) 1989-2014. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H @@ -122,17 +141,15 @@ void test_adjtime(void) olddelta.tv_sec = 0; olddelta.tv_usec = 0; - puts( "adjtime - NULL delta - EINVAL" ); + puts( "adjtime - NULL delta - OK" ); sc = adjtime( NULL, &olddelta ); - rtems_test_assert( sc == -1 ); - rtems_test_assert( errno == EINVAL ); + rtems_test_assert( sc == 0 ); - puts( "adjtime - delta out of range - EINVAL" ); + puts( "adjtime - large us delta - OK" ); delta.tv_sec = 0; delta.tv_usec = 1000000000; /* 100 seconds worth */ sc = adjtime( &delta, &olddelta ); - rtems_test_assert( sc == -1 ); - rtems_test_assert( errno == EINVAL ); + rtems_test_assert( sc == 0 ); puts( "adjtime - delta range of 0 - OK" ); delta.tv_sec = 0; diff --git a/testsuites/psxtests/psxtimer01/psxtimer.c b/testsuites/psxtests/psxtimer01/psxtimer.c index 6ec049ac54..57d23c1582 100644 --- a/testsuites/psxtests/psxtimer01/psxtimer.c +++ b/testsuites/psxtests/psxtimer01/psxtimer.c @@ -1,4 +1,7 @@ -/* +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file POSIX Timer Test * * This is a simple real-time applications which contains 3 periodic tasks. * @@ -10,14 +13,33 @@ * * The share data is protected with a POSIX mutex. * - * Other POSIX facilities such as timers, condition, .. is also used - * + * Other POSIX facilities such as timers, condition, .. are also used. + */ + +/* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H diff --git a/testsuites/psxtests/psxtimer01/system.h b/testsuites/psxtests/psxtimer01/system.h index 9cfd408d86..c04d81b3ef 100644 --- a/testsuites/psxtests/psxtimer01/system.h +++ b/testsuites/psxtests/psxtimer01/system.h @@ -1,11 +1,30 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every * function in the test set. * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ /* functions */ diff --git a/testsuites/psxtests/psxtimer02/psxtimer.c b/testsuites/psxtests/psxtimer02/psxtimer.c index 874a789b7f..26d1d5a67c 100644 --- a/testsuites/psxtests/psxtimer02/psxtimer.c +++ b/testsuites/psxtests/psxtimer02/psxtimer.c @@ -1,4 +1,7 @@ -/* +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file POSIX Timer Test #2 * * This is a simple real-time applications which contains 3 periodic tasks. * @@ -10,14 +13,33 @@ * * The share data is protected with a POSIX mutex. * - * Other POSIX facilities such as timers, condition, .. is also used - * + * Other POSIX facilities such as timers, condition, .. are also used. + */ + +/* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H diff --git a/testsuites/psxtests/psxtimer02/system.h b/testsuites/psxtests/psxtimer02/system.h index a173f3eb02..57a73325ce 100644 --- a/testsuites/psxtests/psxtimer02/system.h +++ b/testsuites/psxtests/psxtimer02/system.h @@ -1,11 +1,30 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every * function in the test set. * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ /* functions */ diff --git a/testsuites/psxtests/psxtimer_face01/psxtimer.c b/testsuites/psxtests/psxtimer_face01/psxtimer.c new file mode 100644 index 0000000000..155afc5ce0 --- /dev/null +++ b/testsuites/psxtests/psxtimer_face01/psxtimer.c @@ -0,0 +1,123 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file POSIX Timer Test of FACE Behavior + */ + +/* + * COPYRIGHT (c) 2022. On-Line Applications Research Corporation (OAR). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <pmacros.h> +#include "tmacros.h" + +#include <unistd.h> +#include <errno.h> +#include <sched.h> +#include <time.h> /* time facilities */ +#include <stdio.h> /* console facilities */ + +const char rtems_test_name[] = "PSXTIMER FACE 1"; + +static void *POSIX_Init ( + void *argument +) + +{ + struct sigevent event; + int status; + timer_t timer; + + /* + * If these are not filled in correctly, we do not execute pass the + * error checking for a NULL event pointer. + */ + event.sigev_notify = SIGEV_SIGNAL; + event.sigev_signo = SIGUSR1; + + TEST_BEGIN(); + + /* + * When FACE timer behavior is configured, creating a POSIX timer + * using CLOCK_REALTIME is not allowed. + */ + puts( "timer_create - CLOCK_REALTIME forbidden - EPERM" ); + status = timer_create( CLOCK_REALTIME, &event, &timer ); + fatal_posix_service_status_errno( status, EPERM, "not allowed" ); + + /* + * When FACE timer behavior is configured, creating a POSIX timer + * on a value other than CLOCK_REALTIME or CLOCK_MONOTONIC is not allowed. + */ + puts( "timer_create - CLOCK_PROCESS_CPUTIME_ID not allowed - EINVAL" ); + status = timer_create( CLOCK_PROCESS_CPUTIME_ID, &event, &timer ); + fatal_posix_service_status_errno( status, EINVAL, "invalid clock" ); + + /* + * When FACE timer behavior is configured, creating a POSIX timer + * on CLOCK_MONOTONIC allowed. + */ + puts( "timer_create - OK" ); + status = timer_create( CLOCK_MONOTONIC, &event, &timer ); + posix_service_failed( status, "timer_create OK" ); + + /* + * Delete the previously created timer. + */ + puts( "timer_delete - OK" ); + status = timer_delete( timer ); + posix_service_failed( status, "timer_delete ok" ); + + /* + */ + puts( "timer_create - CLOCK_MONOTONIC is allowed - OK" ); + status = timer_create( CLOCK_MONOTONIC, &event, &timer ); + posix_service_failed( status, "timer_create ok" ); + + TEST_END(); + rtems_test_exit (0); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 +#define CONFIGURE_MAXIMUM_POSIX_TIMERS 1 + +#define CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> + +/* end of include file */ diff --git a/testsuites/psxtests/psxtimer_face01/psxtimer_face01.doc b/testsuites/psxtests/psxtimer_face01/psxtimer_face01.doc new file mode 100644 index 0000000000..e975419539 --- /dev/null +++ b/testsuites/psxtests/psxtimer_face01/psxtimer_face01.doc @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: BSD-2-Clause + +# COPYRIGHT (c) 1989-2009. +# On-Line Applications Research Corporation (OAR). +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +This file describes the directives and concepts tested by this test set. + +test set name: psxtimer_face01 + +directives: + timer_create + CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR + +concepts: + ++ This test exercises the CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR configure + option which alters the behavior of timer_create(). + + - With CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR defined, timer_create() + returns EPERM to indicate this is not allowed. + + - With CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR defined, timer_create() + for CLOCK_MONOTONIC is allowed. + + - With CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR defined, timer_create() + for any other clock value is an error. + diff --git a/testsuites/psxtests/psxtimer_face01/psxtimer_face01.scn b/testsuites/psxtests/psxtimer_face01/psxtimer_face01.scn new file mode 100644 index 0000000000..b83b41f281 --- /dev/null +++ b/testsuites/psxtests/psxtimer_face01/psxtimer_face01.scn @@ -0,0 +1,6 @@ +*** BEGIN OF TEST FACE 1 *** +timer_create - CLOCK_REALTIME forbidden - EPERM +timer_create - CLOCK_PROCESS_CPUTIME_ID not allowed - EINVAL +timer_create - OK +timer_delete - OK +*** END OF TEST PSXTIMER FACE 1 *** diff --git a/testsuites/psxtests/psxtimes01/init.c b/testsuites/psxtests/psxtimes01/init.c index d5b573bf15..b7cf491d25 100644 --- a/testsuites/psxtests/psxtimes01/init.c +++ b/testsuites/psxtests/psxtimes01/init.c @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H diff --git a/testsuites/psxtests/psxtimes01/psxtimes01.doc b/testsuites/psxtests/psxtimes01/psxtimes01.doc index 452a0dc252..f4479756dd 100644 --- a/testsuites/psxtests/psxtimes01/psxtimes01.doc +++ b/testsuites/psxtests/psxtimes01/psxtimes01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 1989-2010. # On-Line Applications Research Corporation (OAR). # -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.rtems.org/license/LICENSE. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. # This file describes the directives and concepts tested by this test set. |