diff options
Diffstat (limited to 'testsuites/libtests')
370 files changed, 11434 insertions, 5190 deletions
diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am deleted file mode 100644 index 2ff05f2b74..0000000000 --- a/testsuites/libtests/Makefile.am +++ /dev/null @@ -1,1568 +0,0 @@ -# -# Library Testsuite -# - -ACLOCAL_AMFLAGS = -I ../aclocal - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../automake/compile.am - -lib_tests = -lib_screens = -lib_docs = - -support_includes = -I$(top_srcdir)/../support/include -test_includes = -I$(top_srcdir)/support - -if TEST_block01 -lib_tests += block01 -lib_screens += block01/block01.scn -lib_docs += block01/block01.doc -block01_SOURCES = block01/init.c -block01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block01) \ - $(support_includes) -endif - -if TEST_block02 -lib_tests += block02 -lib_screens += block02/block02.scn -lib_docs += block02/block02.doc -block02_SOURCES = block02/init.c -block02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block02) \ - $(support_includes) -endif - -if TEST_block03 -lib_tests += block03 -lib_screens += block03/block03.scn -lib_docs += block03/block03.doc -block03_SOURCES = block03/init.c -block03_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block03) \ - $(support_includes) -endif - -if TEST_block04 -lib_tests += block04 -lib_screens += block04/block04.scn -lib_docs += block04/block04.doc -block04_SOURCES = block04/init.c -block04_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block04) \ - $(support_includes) -endif - -if TEST_block05 -lib_tests += block05 -lib_screens += block05/block05.scn -lib_docs += block05/block05.doc block05/block05.png -block05_SOURCES = block05/init.c -block05_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block05) \ - $(support_includes) -endif - -if TEST_block06 -lib_tests += block06 -lib_screens += block06/block06.scn -lib_docs += block06/block06.doc -block06_SOURCES = block06/init.c -block06_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block06) \ - $(support_includes) -endif - -if TEST_block07 -lib_tests += block07 -lib_screens += block07/block07.scn -lib_docs += block07/block07.doc -block07_SOURCES = block07/init.c -block07_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block07) \ - $(support_includes) -endif - -if TEST_block08 -lib_tests += block08 -lib_screens += block08/block08.scn -lib_docs += block08/block08.doc -block08_SOURCES = block08/init.c block08/system.h \ - block08/bdbuf_tests.c block08/bdbuf_tests.h block08/test_disk.c \ - block08/bdbuf_test1_1.c block08/bdbuf_test1_2.c \ - block08/bdbuf_test1_3.c block08/bdbuf_test1_4.c \ - block08/bdbuf_test1_5.c block08/bdbuf_test2_1.c \ - block08/bdbuf_test2_2.c block08/bdbuf_test3_1.c \ - block08/bdbuf_test3_2.c block08/bdbuf_test3_3.c \ - block08/bdbuf_test4_1.c block08/bdbuf_test4_2.c \ - block08/bdbuf_test4_3.c -block08_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block08) \ - $(support_includes) -endif - -if TEST_block09 -lib_tests += block09 -lib_screens += block09/block09.scn -lib_docs += block09/block09.doc -block09_SOURCES = block09/init.c -block09_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block09) \ - $(support_includes) -endif - -if TEST_block10 -lib_tests += block10 -lib_screens += block10/block10.scn -lib_docs += block10/block10.doc block10/block10.png -block10_SOURCES = block10/init.c -block10_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block10) \ - $(support_includes) -endif - -if TEST_block11 -lib_tests += block11 -lib_screens += block11/block11.scn -lib_docs += block11/block11.doc -block11_SOURCES = block11/init.c -block11_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block11) \ - $(support_includes) -endif - -if TEST_block12 -lib_tests += block12 -lib_screens += block12/block12.scn -lib_docs += block12/block12.doc -block12_SOURCES = block12/init.c -block12_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block12) \ - $(support_includes) -endif - -if TEST_block13 -lib_tests += block13 -lib_screens += block13/block13.scn -lib_docs += block13/block13.doc -block13_SOURCES = block13/init.c -block13_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block13) \ - $(support_includes) -endif - -if TEST_block14 -lib_tests += block14 -lib_screens += block14/block14.scn -lib_docs += block14/block14.doc -block14_SOURCES = block14/init.c -block14_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block14) \ - $(support_includes) -endif - -if TEST_block15 -lib_tests += block15 -lib_screens += block15/block15.scn -lib_docs += block15/block15.doc -block15_SOURCES = block15/init.c -block15_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block15) \ - $(support_includes) -endif - -if TEST_block16 -lib_tests += block16 -lib_screens += block16/block16.scn -lib_docs += block16/block16.doc -block16_SOURCES = block16/init.c -block16_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block16) \ - $(support_includes) -endif - -if TEST_block17 -lib_tests += block17 -lib_screens += block17/block17.scn -lib_docs += block17/block17.doc -block17_SOURCES = block17/init.c -block17_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_block17) \ - $(support_includes) -endif - -if TEST_bspcmdline01 -lib_tests += bspcmdline01 -lib_screens += bspcmdline01/bspcmdline01.scn -lib_docs += bspcmdline01/bspcmdline01.doc -bspcmdline01_SOURCES = bspcmdline01/init.c -bspcmdline01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_bspcmdline01) \ - $(support_includes) -endif - -if TEST_calloc -lib_tests += calloc.norun -calloc_norun_SOURCES = POSIX/calloc.c -calloc_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_capture01 -lib_tests += capture01 -lib_screens += capture01/capture01.scn -lib_docs += capture01/capture01.doc -capture01_SOURCES = capture01/init.c capture01/test1.c \ - capture01/system.h -capture01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_capture01) \ - $(support_includes) -endif - -if TEST_clock_gettime -lib_tests += clock_gettime.norun -clock_gettime_norun_SOURCES = POSIX/clock_gettime.c -clock_gettime_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_close -lib_tests += close.norun -close_norun_SOURCES = POSIX/close.c -close_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_complex -lib_tests += complex -lib_screens += complex/complex.scn -complex_SOURCES = complex/init.c complex/docomplex.c \ - complex/docomplexf.c complex/docomplexl.c -complex_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_complex) \ - $(support_includes) -complex_LDADD = -lm $(LDADD) -endif - -if TEST_cpuuse -lib_tests += cpuuse -lib_screens += cpuuse/cpuuse.scn -cpuuse_SOURCES = cpuuse/init.c cpuuse/task1.c cpuuse/task2.c \ - cpuuse/task3.c cpuuse/tswitch.c cpuuse/system.h -cpuuse_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_cpuuse) \ - $(support_includes) -endif - -if TEST_crypt01 -lib_tests += crypt01 -lib_screens += crypt01/crypt01.scn -lib_docs += crypt01/crypt01.doc -crypt01_SOURCES = crypt01/init.c -crypt01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_crypt01) \ - $(support_includes) -endif - -if DEBUGGERTESTS -if TEST_debugger01 -lib_tests += debugger01 -lib_screens += debugger01/debugger01.scn -debugger01_SOURCES = debugger01/init.c debugger01/remote.c \ - debugger01/system.h -debugger01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_debugger01) \ - $(support_includes) -debugger01_LDADD = $(RTEMS_ROOT)cpukit/libdebugger.a $(LDADD) -endif -endif - -if TEST_defaultconfig01 -lib_tests += defaultconfig01 -lib_screens += defaultconfig01/defaultconfig01.scn -lib_docs += defaultconfig01/defaultconfig01.doc -defaultconfig01_SOURCES = defaultconfig01/init.c -defaultconfig01_CPPFLAGS = $(AM_CPPFLAGS) \ - $(TEST_FLAGS_defaultconfig01) $(support_includes) -defaultconfig01_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_devfs01 -lib_tests += devfs01 -lib_screens += devfs01/devfs01.scn -lib_docs += devfs01/devfs01.doc -devfs01_SOURCES = devfs01/init.c -devfs01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_devfs01) \ - $(support_includes) -endif - -if TEST_devfs04 -lib_tests += devfs04 -lib_screens += devfs04/devfs04.scn -lib_docs += devfs04/devfs04.doc -devfs04_SOURCES = devfs04/init.c devfs04/test_driver.c \ - devfs04/test_driver.h -devfs04_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_devfs04) \ - $(support_includes) -endif - -if TEST_deviceio01 -lib_tests += deviceio01 -lib_screens += deviceio01/deviceio01.scn -lib_docs += deviceio01/deviceio01.doc -deviceio01_SOURCES = deviceio01/init.c deviceio01/test_driver.c \ - deviceio01/test_driver.h -deviceio01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_deviceio01) \ - $(support_includes) -endif - -if TEST_devnullfatal01 -lib_tests += devnullfatal01 -lib_screens += devnullfatal01/devnullfatal01.scn -lib_docs += devnullfatal01/devnullfatal01.doc -devnullfatal01_SOURCES = devnullfatal01/init.c -devnullfatal01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_devnullfatal01) \ - $(support_includes) -endif - -if DLTESTS -if TEST_dl01 -lib_tests += dl01 -lib_screens += dl01/dl01.scn -lib_docs += dl01/dl01.doc -dl01_SOURCES = dl01/init.c dl01/dl-load.c dl01-tar.c dl01-tar.h -dl01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl01) $(support_includes) -dl01/init.c: dl01-tar.o -dl01.pre: $(dl01_OBJECTS) $(dl01_DEPENDENCIES) - @rm -f dl01.pre - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl01-o1.o: dl01/dl01-o1.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl01.tar: dl01-o1.o - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ $< -dl01-tar.c: dl01.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl01-tar.h: dl01.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl01-tar.o: dl01-tar.c dl01-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl01-sym.o: dl01.pre - $(AM_V_GEN)rtems-syms -e -C $(CC) -c "$(CFLAGS)" -o $@ $< -dl01$(EXEEXT): $(dl01_OBJECTS) $(dl01_DEPENDENCIES) dl01-sym.o - @rm -f $@ - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -CLEANFILES += dl01.pre dl01-sym.o dl02-o1.o dl01.tar dl01-tar.h -endif -endif - -if DLTESTS -if TEST_dl02 -lib_tests += dl02 -lib_screens += dl02/dl02.scn -lib_docs += dl02/dl02.doc -dl02_SOURCES = dl02/init.c dl02/dl-load.c dl02-tar.c dl02-tar.h -dl02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl02) $(support_includes) -dl02/init.c: dl02-tar.o -dl02.pre: $(dl02_OBJECTS) $(dl02_DEPENDENCIES) - @rm -f dl02.pre - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl02-o1.o: dl02/dl02-o1.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl02-o2.o: dl02/dl02-o2.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl02.tar: dl02-o1.o dl02-o2.o - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ $+ -dl02-tar.c: dl02.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl02-tar.h: dl02.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl02-tar.o: dl02-tar.c dl02-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl02-sym.o: dl02.pre - $(AM_V_GEN)rtems-syms -e -C $(CC) -c "$(CFLAGS)" -o $@ $< -dl02$(EXEEXT): $(dl02_OBJECTS) $(dl02_DEPENDENCIES) dl02-sym.o - @rm -f $@ - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -CLEANFILES += dl02.pre dl02-sym.o dl02-o1.o dl02-o2.o dl02.tar dl02-tar.h -endif -endif - -if DLTESTS -if TEST_dl03 -lib_tests += dl03 -lib_screens += dl03/dl03.scn -lib_docs += dl03/dl03.doc -dl03_SOURCES = dl03/init.c dl03/dl-cache.c dl03/dl-bit-alloc.c -dl03_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl03) $(support_includes) \ - -I$(top_srcdir)/../../cpukit/libdl -endif -endif - -if DLTESTS -if HAS_CXX -if TEST_dl04 -lib_tests += dl04 -lib_screens += dl04/dl04.scn -lib_docs += dl04/dl04.doc -dl04_SOURCES = dl04/init.c dl04/dl-load.c dl04/dl-cpp.cc dl04-tar.c \ - dl04-tar.h -dl04_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl04) $(support_includes) -dl04/init.c: dl04-tar.o -dl04.pre: $(dl04_OBJECTS) $(dl04_DEPENDENCIES) - @rm -f dl04.pre - $(AM_V_CXXLD)$(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl04-o4.o: dl04/dl04-o4.cc Makefile - $(AM_V_GEN)$(CXXCOMPILE) -c -o $@ $< -dl04.tar: dl04-o4.o - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ $< -dl04-tar.c: dl04.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl04-tar.h: dl04.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl04-tar.o: dl04-tar.c dl04-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl04-sym.o: dl04.pre - $(AM_V_GEN)rtems-syms -e -C $(CC) -c "$(CFLAGS)" -o $@ $< -dl04$(EXEEXT): $(dl04_OBJECTS) $(dl04_DEPENDENCIES) dl04-sym.o - @rm -f $@ - $(AM_V_CXXLD)$(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -CLEANFILES += dl04.pre dl04-sym.o dl04-o4.o dl04.tar dl04-tar.h -endif -endif -endif - -if DLTESTS -if HAS_CXX -if TEST_dl05 -lib_tests += dl05 -lib_screens += dl05/dl05.scn -lib_docs += dl05/dl05.doc -dl05_SOURCES = dl05/init.c dl05/dl-load.c dl05/dl-cpp.cc dl05-tar.c \ - dl05-tar.h -dl05_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl05) $(support_includes) -dl05/init.c: dl05-tar.o -dl05.pre: $(dl05_OBJECTS) $(dl05_DEPENDENCIES) - @rm -f dl05.pre dl05-sym.o - $(AM_V_CXXLD)$(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl05-o5.o: dl05/dl05-o5.cc - $(AM_V_CXX)$(CXXCOMPILE) -c -o $@ $< -dl05.tar: dl05-o5.o - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ $< -dl05-tar.c: dl05.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl05-tar.h: dl05.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl05-tar.o: dl05-tar.c dl05-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl05-sym.o: dl05.pre - $(AM_V_GEN)rtems-syms -e -C $(CC) -c "$(CFLAGS)" -o $@ $< -dl05$(EXEEXT): $(dl05_OBJECTS) $(dl05_DEPENDENCIES) dl05-sym.o - @rm -f $@ - $(AM_V_CXXLD)$(LINK.cc) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -CLEANFILES += dl05.pre dl05-sym.o dl05-o5.o dl05.tar dl05-tar.h -endif -endif -endif - -if DLTESTS -if TEST_dl06 -lib_tests += dl06 -lib_screens += dl06/dl06.scn -lib_docs += dl06/dl06.doc -dl06_SOURCES = dl06/init.c dl06/dl-load.c dl06-tar.c dl06-tar.h -dl06_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl06) $(support_includes) -dl06/init.c: dl06-tar.o -dl06-pre.tar: Makefile - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ -s ,$(srcdir)/dl06/,, $(srcdir)/dl06/dl06_pre_file -dl06-pre-tar.c: dl06-pre.tar - $(AM_V_GEN)$(BIN2C) -N dl06_tar -C $< $@ -dl06-pre-tar.h: dl06-pre.tar - $(AM_V_GEN)$(BIN2C) -N dl06_tar -H $< $@ -dl06-pre-tar.o: dl06-pre-tar.c dl06-pre-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl06-pre-init.o: dl06-pre-tar.o - $(AM_V_CC)$(COMPILE) $(dl06_CPPFLAGS) $(CPU_CFLAGS) $(AM_CFLAGS) \ - -c -o $@ $(srcdir)/dl06/pre-init.c -dl06.pre: dl06-pre-init.o dl06/dl06-dl-load.o dl06-pre-tar.o - @rm -f $@ dl06-sym.o - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ $(LDADD) -dl06-o1.o: dl06/dl06-o1.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl06-o2.o: dl06/dl06-o2.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl06.rap: dl06.pre dl06-o1.o dl06-o2.o - $(AM_V_GEN)rtems-ld -r $(RTEMS_BUILD_ROOT) \ - -C $(CC) -c "$(CPU_CFLAGS)" \ - -O rap -b $< -e rtems_main -s \ - -o $@ $(filter-out dl06.pre,$+) -lm -dl06.tar: dl06.rap - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ $< -dl06-tar.c: dl06.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl06-tar.h: dl06.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl06-tar.o: dl06-tar.c dl06-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl06-sym.o: dl06.pre - $(AM_V_GEN)rtems-syms -e -C $(CC) -c "$(CFLAGS)" -o $@ $< -dl06$(EXEEXT): $(dl06_OBJECTS) dl06-sym.o - @rm -f $@ - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ $(LDADD) -CLEANFILES += dl06.pre dl06-sym.o dl06-o1.o dl06-o2.o dl06.tar dl06-tar.h -endif -endif - -if DLTESTS -if TEST_dl07 -lib_tests += dl07 -lib_screens += dl07/dl07.scn -lib_docs += dl07/dl07.doc -dl07_SOURCES = dl07/init.c dl07/dl-load.c dl07-tar.c dl07-tar.h -dl07_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl07) $(support_includes) -dl07/init.c: dl07-tar.o -dl07.pre: $(dl07_OBJECTS) $(dl07_DEPENDENCIES) - @rm -f dl07.pre dl07-sym.o - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl07-o1.o: dl07/dl07-o1.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-o2.o: dl07/dl07-o2.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-o3.o: dl07/dl07-o3.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-o4.o: dl07/dl07-o4.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-o5.o: dl07/dl07-o5.c Makefile - $(AM_V_CC) $(COMPILE) -c -o $@ $< -dl07.tar: dl07-o1.o dl07-o2.o dl07-o3.o dl07-o4.o dl07-o5.o - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ $+ -dl07-tar.c: dl07.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl07-tar.h: dl07.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl07-tar.o: dl07-tar.c dl07-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl07-sym.o: dl07.pre - $(AM_V_GEN)rtems-syms -e -C $(CC) -c "$(CFLAGS)" -o $@ $< -dl07$(EXEEXT): $(dl07_OBJECTS) $(dl07_DEPENDENCIES) dl07-sym.o - @rm -f $@ - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -CLEANFILES += dl07.pre dl07-sym.o dl07-o1.o dl07-o2.o dl07-o3.o dl07-o4.o \ - dl07-o5.o dl07.tar dl07-tar.h -endif -endif - -if DLTESTS -if TEST_dl08 -lib_tests += dl08 -lib_screens += dl08/dl08.scn -lib_docs += dl08/dl08.doc -dl08_SOURCES = dl08/init.c dl08/dl-load.c dl08-tar.c dl08-tar.h -dl08_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl08) $(support_includes) -dl08/init.c: dl08-tar.o -dl08.pre: $(dl08_OBJECTS) $(dl08_DEPENDENCIES) - @rm -f dl08.pre dl08-syms.o - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl08-o1.o: dl08/dl08-o1.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o2.o: dl08/dl08-o2.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o3.o: dl08/dl08-o3.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o4.o: dl08/dl08-o4.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o5.o: dl08/dl08-o5.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-o6-123456789-123456789.o: dl08/dl08-o6-123456789-123456789.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -noinst_LIBRARIES = libdl08_1.a libdl08_2.a -libdl08_1_a_SOURCES = dl08-o2.c dl08-o4.c -libdl08_2_a_SOURCES = dl08-o3.c dl08-o5.c \ - dl08-o6-123456789-123456789.c -dl08.tar: dl08-o1.o libdl08_1.a libdl08_2.a - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ -s ,$(srcdir)/dl08/,, $(srcdir)/dl08/etc/libdl.conf $+ -dl08-tar.c: dl08.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl08-tar.h: dl08.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl08-tar.o: dl08-tar.c dl08-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl08-sym.o: dl08.pre - $(AM_V_GEN)rtems-syms -e -c "$(CFLAGS)" -o $@ $< -dl08$(EXEEXT): $(dl08_OBJECTS) $(dl08_DEPENDENCIES) dl08-sym.o - @rm -f $@ - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -CLEANFILES += dl08.pre dl08-sym.o libdl08_1.a libdl08_2.a dl08-o1.o dl08-o2.o \ - dl08-o3.o dl08-o4.o dl08-o5.o dl08-o6-123456789-123456789.o \ - dl08.tar dl08-tar.h -endif -endif - -if DLTESTS -if TEST_dl09 -lib_tests += dl09 -lib_screens += dl09/dl09.scn -lib_docs += dl09/dl09.doc -dl09_SOURCES = dl09/init.c dl09/dl-load.c dl09-tar.c dl09-tar.h -dl09_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl09) $(support_includes) -dl09/init.c: dl09-tar.o -dl09.pre: $(dl09_OBJECTS) $(dl09_DEPENDENCIES) - @rm -f dl09.pre dl09-syms.o - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl09-o1.o: dl09/dl09-o1.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-o2.o: dl09/dl09-o2.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-o3.o: dl09/dl09-o3.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-o4.o: dl09/dl09-o4.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-o5.o: dl09/dl09-o5.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09.tar: dl09-o1.o dl09-o2.o dl09-o3.o dl09-o4.o dl09-o5.o - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ $+ -dl09-tar.c: dl09.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl09-tar.h: dl09.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl09-tar.o: dl09-tar.c dl09-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl09-sym.o: dl09.pre - $(AM_V_GEN)rtems-syms -e -C $(CC) -c "$(CFLAGS)" -o $@ $< -dl09$(EXEEXT): $(dl09_OBJECTS) $(dl09_DEPENDENCIES) dl09-sym.o - @rm -f $@ - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -CLEANFILES += dl09.pre dl09-sym.o dl09-o1.o dl09-o2.o dl09-o3.o dl09-o4.o \ - dl09-o5.o dl09.tar dl09-tar.h -endif -endif - -if DLTESTS -if TEST_dl10 -lib_tests += dl10 -lib_screens += dl10/dl10.scn -lib_docs += dl10/dl10.doc -dl10_SOURCES = dl10/init.c dl10/dl-load.c dl10-tar.c dl10-tar.h -dl10_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dl10) $(support_includes) -dl10/init.c: dl10-tar.o -dl10.pre: $(dl10_OBJECTS) $(dl10_DEPENDENCIES) - @rm -f dl10.pre dl10-syms.o - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -dl10-o1.o: dl10/dl10-o1.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o2.o: dl10/dl10-o2.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o3.o: dl10/dl10-o3.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o4.o: dl10/dl10-o4.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o5.o: dl10/dl10-o5.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-o6.o: dl10/dl10-o6.c Makefile - $(AM_V_CC)$(COMPILE) -c -o $@ $< -noinst_LIBRARIES = libdl10_1.a libdl10_2.a -libdl10_1_a_SOURCES = dl10-o2.c dl10-o4.c -libdl10_2_a_SOURCES = dl10-o3.c dl10-o5.c dl10-o6.c -dl10.tar: dl10-o1.o libdl10_1.a libdl10_2.a - @rm -f $@ - $(AM_V_GEN)$(PAX) -w -f $@ -s ,$(srcdir)/dl10/,, $(srcdir)/dl10/etc/libdl.conf $+ -dl10-tar.c: dl10.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -dl10-tar.h: dl10.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -dl10-tar.o: dl10-tar.c dl10-tar.h - $(AM_V_CC)$(COMPILE) -c -o $@ $< -dl10-sym.o: dl10.pre - $(AM_V_GEN)rtems-syms -e -c "$(CFLAGS)" -o $@ $< -dl10$(EXEEXT): $(dl10_OBJECTS) $(dl10_DEPENDENCIES) dl10-sym.o - @rm -f $@ - $(AM_V_CCLD)$(LINK.c) $(CPU_CFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) -o $@ $+ -CLEANFILES += dl10.pre dl10-sym.o libdl10_1.a libdl10_2.a dl10-o1.o dl10-o2.o \ - dl10-o3.o dl10-o4.o dl10-o5.o dl10-o6.o \ - dl10.tar dl10-tar.h etc/libdl-dl10.conf -endif -endif - -if TEST_dumpbuf01 -lib_tests += dumpbuf01 -lib_screens += dumpbuf01/dumpbuf01.scn -lib_docs += dumpbuf01/dumpbuf01.doc -dumpbuf01_SOURCES = dumpbuf01/init.c -dumpbuf01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_dumpbuf01) \ - $(support_includes) -endif - -if TEST_dup2 -lib_tests += dup2.norun -dup2_norun_SOURCES = POSIX/dup2.c -dup2_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_exit01 -lib_tests += exit01 -lib_screens += exit01/exit01.scn -lib_docs += exit01/exit01.doc -exit01_SOURCES = exit01/init.c -exit01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_exit01) \ - $(support_includes) -endif - -if TEST_exit02 -lib_tests += exit02 -lib_screens += exit02/exit02.scn -lib_docs += exit02/exit02.doc -exit02_SOURCES = exit02/init.c -exit02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_exit02) \ - $(support_includes) -endif - -if TEST_fcntl -lib_tests += fcntl.norun -fcntl_norun_SOURCES = POSIX/fcntl.c -fcntl_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_flashdisk01 -lib_tests += flashdisk01 -lib_screens += flashdisk01/flashdisk01.scn -lib_docs += flashdisk01/flashdisk01.doc -flashdisk01_SOURCES = flashdisk01/init.c \ - flashdisk01/test-file-system.c -flashdisk01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_flashdisk01) \ - $(support_includes) -endif - -if TEST_flockfile -lib_tests += flockfile.norun -flockfile_norun_SOURCES = POSIX/flockfile.c -flockfile_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_fork -lib_tests += fork.norun -fork_norun_SOURCES = POSIX/fork.c -fork_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_free -lib_tests += free.norun -free_norun_SOURCES = POSIX/free.c -free_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_fstat -lib_tests += fstat.norun -fstat_norun_SOURCES = POSIX/fstat.c -fstat_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if NETTESTS -if TEST_ftp01 -lib_tests += ftp01 -lib_screens += ftp01/ftp01.scn -lib_docs += ftp01/ftp01.doc -ftp01_SOURCES = ftp01/init.c -ftp01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_ftp01) \ - $(support_includes) -I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking -ftp01_LDADD = $(RTEMS_ROOT)cpukit/libftpd.a $(RTEMS_ROOT)cpukit/libftpfs.a $(LDADD) -endif -endif - -if TEST_ftrylockfile -lib_tests += ftrylockfile.norun -ftrylockfile_norun_SOURCES = POSIX/ftrylockfile.c -ftrylockfile_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_funlockfile -lib_tests += funlockfile.norun -funlockfile_norun_SOURCES = POSIX/funlockfile.c -funlockfile_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_getentropy01 -lib_tests += getentropy01 -lib_screens += getentropy01/getentropy01.scn -lib_docs += getentropy01/getentropy01.doc -getentropy01_SOURCES = getentropy01/init.c -getentropy01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_getentropy01) \ - $(support_includes) -endif - -if TEST_getlogin -lib_tests += getlogin.norun -getlogin_norun_SOURCES = POSIX/getlogin.c -getlogin_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_getpwnam -lib_tests += getpwnam.norun -getpwnam_norun_SOURCES = POSIX/getpwnam.c -getpwnam_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_getpwuid -lib_tests += getpwuid.norun -getpwuid_norun_SOURCES = POSIX/getpwuid.c -getpwuid_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_gettimeofday -lib_tests += gettimeofday.norun -gettimeofday_norun_SOURCES = POSIX/gettimeofday.c -gettimeofday_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_getuid -lib_tests += getuid.norun -getuid_norun_SOURCES = POSIX/getuid.c -getuid_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_gxx01 -lib_tests += gxx01 -lib_screens += gxx01/gxx01.scn -lib_docs += gxx01/gxx01.doc -gxx01_SOURCES = gxx01/init.c -gxx01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_gxx01) \ - $(support_includes) -endif - -if TEST_heapwalk -lib_tests += heapwalk -lib_screens += heapwalk/heapwalk.scn -heapwalk_SOURCES = heapwalk/init.c heapwalk/system.h -heapwalk_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_heapwalk) \ - $(support_includes) -endif - -if TEST_htonl -lib_tests += htonl.norun -htonl_norun_SOURCES = POSIX/htonl.c -htonl_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_i2c01 -lib_tests += i2c01 -lib_screens += i2c01/i2c01.scn -lib_docs += i2c01/i2c01.doc -i2c01_SOURCES = i2c01/init.c -i2c01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_i2c01) \ - $(support_includes) -endif - -if TEST_iconv -lib_tests += iconv.norun -iconv_norun_SOURCES = POSIX/iconv.c -iconv_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_iconv_close -lib_tests += iconv_close.norun -iconv_close_norun_SOURCES = POSIX/iconv_close.c -iconv_close_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_iconv_open -lib_tests += iconv_open.norun -iconv_open_norun_SOURCES = POSIX/iconv_open.c -iconv_open_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_kill -lib_tests += kill.norun -kill_norun_SOURCES = POSIX/kill.c -kill_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_libfdt01 -lib_tests += libfdt01 -lib_screens += libfdt01/libfdt01.scn -lib_docs += libfdt01/libfdt01.doc -libfdt01_SOURCES = libfdt01/init.c libfdt01/some.c -libfdt01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_libfdt01) \ - $(support_includes) -endif - -if TEST_longjmp -lib_tests += longjmp.norun -longjmp_norun_SOURCES = POSIX/longjmp.c -longjmp_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_lseek -lib_tests += lseek.norun -lseek_norun_SOURCES = POSIX/lseek.c -lseek_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_lstat -lib_tests += lstat.norun -lstat_norun_SOURCES = POSIX/lstat.c -lstat_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_malloc -lib_tests += malloc.norun -malloc_norun_SOURCES = POSIX/malloc.c -malloc_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_malloc02 -lib_tests += malloc02 -lib_screens += malloc02/malloc02.scn -lib_docs += malloc02/malloc02.doc -malloc02_SOURCES = malloc02/init.c -malloc02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_malloc02) \ - $(support_includes) -endif - -if TEST_malloc03 -lib_tests += malloc03 -lib_screens += malloc03/malloc03.scn -lib_docs += malloc03/malloc03.doc -malloc03_SOURCES = malloc03/init.c -malloc03_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_malloc03) \ - $(support_includes) -endif - -if TEST_malloc04 -lib_tests += malloc04 -lib_screens += malloc04/malloc04.scn -lib_docs += malloc04/malloc04.doc -malloc04_SOURCES = malloc04/init.c -malloc04_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_malloc04) \ - $(support_includes) -endif - -if TEST_malloctest -lib_tests += malloctest -lib_screens += malloctest/malloctest.scn -malloctest_SOURCES = malloctest/init.c malloctest/task1.c \ - malloctest/system.h -malloctest_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_malloctest) \ - $(support_includes) -endif - -if TEST_math -lib_tests += math -lib_screens += math/math.scn -math_SOURCES = math/init.c math/domath.c -math_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_math) $(support_includes) \ - -I$(top_srcdir)/math -math_LDADD = -lm $(LDADD) -endif - -if TEST_mathf -lib_tests += mathf -lib_screens += mathf/mathf.scn -mathf_SOURCES = mathf/init.c mathf/domathf.c -mathf_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mathf) \ - $(support_includes) -I$(top_srcdir)/math -mathf_LDADD = -lm $(LDADD) -endif - -if TEST_mathl -lib_tests += mathl -lib_screens += mathl/mathl.scn -mathl_SOURCES = mathl/init.c mathl/domathl.c -mathl_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mathl) \ - $(support_includes) -I$(top_srcdir)/math -mathl_LDADD = -lm $(LDADD) -endif - -if TEST_md501 -lib_tests += md501 -lib_screens += md501/md501.scn -lib_docs += md501/md501.doc -md501_SOURCES = md501/init.c -md501_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_md501) \ - $(support_includes) -endif - -if NETTESTS -if HAS_POSIX -if TEST_mghttpd01 -lib_tests += mghttpd01 -lib_screens += mghttpd01/mghttpd01.scn -lib_docs += mghttpd01/mghttpd01.doc -mghttpd01_SOURCES = mghttpd01/init.c mghttpd01-tar.c \ - mghttpd01-tar.h mghttpd01/test-http-client.c \ - mghttpd01/test-http-client.h -mghttpd01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mghttpd01) \ - $(support_includes) -I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking -mghttpd01_LDADD = $(RTEMS_ROOT)cpukit/libmghttpd.a $(LDADD) -mghttpd01-tar.c: mghttpd01/mghttpd01.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -mghttpd01-tar.h: mghttpd01/mghttpd01.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -mghttpd01-tar.o: mghttpd01-tar.c mghttpd01-tar.h -mghttpd01/init.c: mghttpd01-tar.h -CLEANFILES += mghttpd01.tar mghttpd01-tar.c mghttpd01-tar.h -endif -endif -endif - -if TEST_monitor -lib_tests += monitor -monitor_SOURCES = monitor/init.c monitor/system.h -monitor_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_monitor) \ - $(support_includes) -endif - -if TEST_monitor02 -lib_tests += monitor02 -lib_screens += monitor02/monitor02.scn -monitor02_SOURCES = monitor02/init.c monitor02/system.h -monitor02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_monitor02) \ - $(support_includes) -endif - -if TEST_mouse01 -lib_tests += mouse01 -lib_screens += mouse01/mouse01.scn -lib_docs += mouse01/mouse01.doc -mouse01_SOURCES = mouse01/init.c mouse01/serial_mouse_config.c \ - mouse01/msmouse.c termios04/termios_testdriver_intr.c -mouse01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_mouse01) \ - $(support_includes) -endif - -if TEST_nanosleep -lib_tests += nanosleep.norun -nanosleep_norun_SOURCES = POSIX/nanosleep.c -nanosleep_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if NETTESTS -if TEST_networking01 -lib_tests += networking01 -lib_screens += networking01/networking01.scn -lib_docs += networking01/networking01.doc -networking01_SOURCES = networking01/init.c -networking01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_networking01) \ - $(support_includes) -I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking -endif -endif - -if TEST_newlib01 -lib_tests += newlib01 -lib_screens += newlib01/newlib01.scn -lib_docs += newlib01/newlib01.doc -newlib01_SOURCES = newlib01/init.c -newlib01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_newlib01) \ - $(support_includes) -endif - -if TEST_open -lib_tests += open.norun -open_norun_SOURCES = POSIX/open.c -open_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_pipe -lib_tests += pipe.norun -pipe_norun_SOURCES = POSIX/pipe.c -pipe_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_posix_memalign -lib_tests += posix_memalign.norun -posix_memalign_norun_SOURCES = POSIX/posix_memalign.c -posix_memalign_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_putenvtest -lib_tests += putenvtest -lib_screens += putenvtest/putenvtest.scn -putenvtest_SOURCES = putenvtest/init.c -putenvtest_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_putenvtest) \ - $(support_includes) -endif - -if TEST_pwdgrp01 -lib_tests += pwdgrp01 -lib_screens += pwdgrp01/pwdgrp01.scn -lib_docs += pwdgrp01/pwdgrp01.doc -pwdgrp01_SOURCES = pwdgrp01/init.c -pwdgrp01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_pwdgrp01) \ - $(support_includes) -endif - -if TEST_pwdgrp02 -lib_tests += pwdgrp02 -lib_screens += pwdgrp02/pwdgrp02.scn -lib_docs += pwdgrp02/pwdgrp02.doc -pwdgrp02_SOURCES = pwdgrp02/init.c -pwdgrp02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_pwdgrp02) \ - $(support_includes) -endif - -if TEST_rbheap01 -lib_tests += rbheap01 -lib_screens += rbheap01/rbheap01.scn -lib_docs += rbheap01/rbheap01.doc -rbheap01_SOURCES = rbheap01/init.c -rbheap01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_rbheap01) \ - $(support_includes) -endif - -if TEST_read -lib_tests += read.norun -read_norun_SOURCES = POSIX/read.c -read_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_readv -lib_tests += readv.norun -readv_norun_SOURCES = POSIX/readv.c -readv_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_realloc -lib_tests += realloc.norun -realloc_norun_SOURCES = POSIX/realloc.c -realloc_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_record01 -lib_tests += record01 -lib_screens += record01/record01.scn -lib_docs += record01/record01.doc -record01_SOURCES = record01/init.c -record01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_record01) \ - $(support_includes) -I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking -endif - -if TEST_record02 -lib_tests += record02 -lib_screens += record02/record02.scn -lib_docs += record02/record02.doc -record02_SOURCES = record02/init.c -record02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_record02) \ - $(support_includes) -record02_LDADD = $(RTEMS_ROOT)cpukit/librtemscpu.a $(RTEMS_ROOT)cpukit/libz.a $(LDADD) -endif - -if TEST_rtmonuse -lib_tests += rtmonuse -lib_screens += rtmonuse/rtmonuse.scn -rtmonuse_SOURCES = rtmonuse/init.c rtmonuse/getall.c rtmonuse/task1.c \ - rtmonuse/system.h -rtmonuse_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_rtmonuse) \ - $(support_includes) -endif - -if TEST_setjmp -lib_tests += setjmp.norun -setjmp_norun_SOURCES = POSIX/setjmp.c -setjmp_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_sha -lib_tests += sha -lib_screens += sha/sha.scn -lib_docs += sha/sha.doc -sha_SOURCES = sha/init.c -sha_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_sha) $(support_includes) -endif - -if TEST_shell01 -lib_tests += shell01 -lib_screens += shell01/shell01.scn -lib_docs += shell01/shell01.doc -shell01_SOURCES = shell01/init.c -shell01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_shell01) \ - $(support_includes) -endif - -if TEST_sigaddset -lib_tests += sigaddset.norun -sigaddset_norun_SOURCES = POSIX/sigaddset.c -sigaddset_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_sigdelset -lib_tests += sigdelset.norun -sigdelset_norun_SOURCES = POSIX/sigdelset.c -sigdelset_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_sigemptyset -lib_tests += sigemptyset.norun -sigemptyset_norun_SOURCES = POSIX/sigemptyset.c -sigemptyset_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_sigfillset -lib_tests += sigfillset.norun -sigfillset_norun_SOURCES = POSIX/sigfillset.c -sigfillset_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_sigismember -lib_tests += sigismember.norun -sigismember_norun_SOURCES = POSIX/sigismember.c -sigismember_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_sigprocmask -lib_tests += sigprocmask.norun -sigprocmask_norun_SOURCES = POSIX/sigprocmask.c -sigprocmask_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_sparsedisk01 -lib_tests += sparsedisk01 -lib_screens += sparsedisk01/sparsedisk01.scn -lib_docs += sparsedisk01/sparsedisk01.doc -sparsedisk01_SOURCES = sparsedisk01/init.c -sparsedisk01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_sparsedisk01) \ - $(support_includes) -endif - -if TEST_spi01 -lib_tests += spi01 -lib_screens += spi01/spi01.scn -lib_docs += spi01/spi01.doc -spi01_SOURCES = spi01/init.c -spi01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spi01) \ - $(support_includes) -endif - -if TEST_stackchk -lib_tests += stackchk -lib_screens += stackchk/stackchk.scn -stackchk_SOURCES = stackchk/blow.c stackchk/init.c stackchk/task1.c \ - stackchk/system.h -stackchk_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_stackchk) \ - $(support_includes) -endif - -if TEST_stackchk01 -lib_tests += stackchk01 -lib_screens += stackchk01/stackchk01.scn -lib_docs += stackchk01/stackchk01.doc -stackchk01_SOURCES = stackchk01/init.c -stackchk01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_stackchk01) \ - $(support_includes) -endif - -if TEST_stat -lib_tests += stat.norun -stat_norun_SOURCES = POSIX/stat.c -stat_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_stringto01 -lib_tests += stringto01 -lib_screens += stringto01/stringto01.scn -lib_docs += stringto01/stringto01.doc -stringto01_SOURCES = stringto01/init.c \ - stringto01/stringto_test_template.h -stringto01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_stringto01) \ - $(support_includes) -endif - -if NETTESTS -if TEST_syscall01 -lib_tests += syscall01 -lib_screens += syscall01/syscall01.scn -lib_docs += syscall01/syscall01.doc -syscall01_SOURCES = syscall01/init.c -syscall01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_syscall01) \ - $(support_includes) -I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking -endif -endif - -if TARTESTS -if TEST_tar01 -lib_tests += tar01 -lib_screens += tar01/tar01.scn -lib_docs += tar01/tar01.doc -tar01_SOURCES = tar01/init.c ../psxtests/psxfile01/test_cat.c \ - tar01-tar.c tar01-tar.h tar01-tar-gz.c tar01-tar-gz.h -if TARTEST_XZ -tar01_SOURCES += tar01-tar-xz.c tar01-tar-xz.h -endif -tar01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_tar01) \ - $(support_includes) $(test_includes) -I$(top_srcdir)/include -tar01_LDADD = $(RTEMS_ROOT)cpukit/librtemscpu.a $(RTEMS_ROOT)cpukit/libz.a $(LDADD) -tar01-tar.c: tar01/tar01.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -tar01-tar.h: tar01/tar01.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -tar01-tar.o: tar01-tar.c tar01-tar.h -tar01.tar.gz: tar01/tar01.tar - $(AM_V_GEN)$(GZIP) < $< > $@ -tar01-tar-gz.c: tar01.tar.gz - $(AM_V_GEN)$(BIN2C) -C $< $@ -tar01-tar-gz.h: tar01.tar.gz - $(AM_V_GEN)$(BIN2C) -H $< $@ -CLEANFILES += tar01.tar tar01-tar.c tar01-tar.h \ - tar01.tar.gz tar01-tar-gz.c tar01-tar-gz.h -if TARTEST_XZ -tar01.tar.xz: tar01/tar01.tar - $(AM_V_GEN)$(XZ) < $< > $@ -tar01-tar-xz.c: tar01.tar.xz - $(AM_V_GEN)$(BIN2C) -C $< $@ -tar01-tar-xz.h: tar01.tar.xz - $(AM_V_GEN)$(BIN2C) -H $< $@ -TAR01_XZ_H = tar01-tar-xz.h -CLEANFILES += tar01.tar.xz tar01-tar-xz.c tar01-tar-xz.h -endif -tar01/init.c: tar01-tar.h tar01-tar-gz.h $(TAR01_XZ_H) -endif -endif - -if TARTESTS -if TEST_tar02 -lib_tests += tar02 -lib_screens += tar02/tar02.scn -lib_docs += tar02/tar02.doc -tar02_SOURCES = tar02/init.c ../psxtests/psxfile01/test_cat.c \ - tar02-tar.c tar02-tar.h -tar02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_tar02) \ - $(support_includes) $(test_includes) -I$(top_srcdir)/include -tar02-tar.c: tar01/tar01.tar - $(AM_V_GEN)$(BIN2C) -C $< $@ -tar02-tar.h: tar01/tar01.tar - $(AM_V_GEN)$(BIN2C) -H $< $@ -tar02-tar.o: tar02-tar.c tar02-tar.h -tar02/init.c: tar02-tar.h -CLEANFILES += tar02.tar tar02-tar.c tar02-tar.h -endif -endif - -if TEST_tar03 -lib_tests += tar03 -lib_screens += tar03/tar03.scn -lib_docs += tar03/tar03.doc -tar03_SOURCES = tar03/init.c -tar03_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_tar03) \ - $(support_includes) -endif - -if NETTESTS -if TEST_telnetd01 -lib_tests += telnetd01 -lib_screens += telnetd01/telnetd01.scn -lib_docs += telnetd01/telnetd01.doc -telnetd01_SOURCES = telnetd01/init.c -telnetd01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_telnetd01) \ - $(support_includes) -I$(RTEMS_SOURCE_ROOT)/cpukit/libnetworking -telnetd01_LDADD = $(RTEMS_ROOT)cpukit/libtelnetd.a $(LDADD) -endif -endif - -if TEST_termios -lib_tests += termios -termios_SOURCES = termios/init.c -termios_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios) \ - $(support_includes) -endif - -if TEST_termios01 -lib_tests += termios01 -lib_screens += termios01/termios01.scn -lib_docs += termios01/termios01.doc -termios01_SOURCES = termios01/init.c termios01/termios_testdriver.c \ - termios01/termios_testdriver.h -termios01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios01) \ - $(support_includes) -I$(top_srcdir)/include -endif - -if TEST_termios02 -lib_tests += termios02 -lib_screens += termios02/termios02.scn -lib_docs += termios02/termios02.doc -termios02_SOURCES = termios02/init.c -termios02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios02) \ - $(support_includes) -I$(top_srcdir)/include -endif - -if TEST_termios03 -lib_tests += termios03 -lib_screens += termios03/termios03.scn -lib_docs += termios03/termios03.doc -termios03_SOURCES = termios03/init.c \ - termios03/termios_testdriver_polled.c \ - termios03/termios_testdriver_polled.h -termios03_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios03) \ - $(support_includes) -endif - -if TEST_termios04 -lib_tests += termios04 -lib_screens += termios04/termios04.scn -lib_docs += termios04/termios04.doc -termios04_SOURCES = termios04/init.c \ - termios04/termios_testdriver_intr.c \ - termios04/termios_testdriver_intr.h -termios04_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios04) \ - $(support_includes) -endif - -if TEST_termios05 -lib_tests += termios05 -lib_screens += termios05/termios05.scn -lib_docs += termios05/termios05.doc -termios05_SOURCES = termios05/init.c \ - termios05/termios_testdriver_task.c -termios05_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios05) \ - $(support_includes) -endif - -if TEST_termios06 -lib_tests += termios06 -lib_screens += termios06/termios06.scn -lib_docs += termios06/termios06.doc -termios06_SOURCES = termios06/init.c \ - termios03/termios_testdriver_polled.c termios06/test_pppd.c -termios06_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios06) \ - $(support_includes) -endif - -if TEST_termios07 -lib_tests += termios07 -lib_screens += termios07/termios07.scn -lib_docs += termios07/termios07.doc -termios07_SOURCES = termios07/init.c \ - termios04/termios_testdriver_intr.c -termios07_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios07) \ - $(support_includes) -endif - -if TEST_termios08 -lib_tests += termios08 -lib_screens += termios08/termios08.scn -lib_docs += termios08/termios08.doc -termios08_SOURCES = termios08/init.c \ - termios03/termios_testdriver_polled.c -termios08_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios08) \ - $(support_includes) -endif - -if TEST_termios09 -lib_tests += termios09 -lib_screens += termios09/termios09.scn -lib_docs += termios09/termios09.doc -termios09_SOURCES = termios09/init.c -termios09_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios09) \ - $(support_includes) -endif - -if TEST_termios10 -if HAS_POSIX -lib_tests += termios10 -lib_screens += termios10/termios10.scn -lib_docs += termios10/termios10.doc -termios10_SOURCES = termios10/init.c -termios10_SOURCES += termios03/termios_testdriver_polled.c -termios10_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios10) \ - $(support_includes) -endif -endif - -if TEST_termios11 -if HAS_POSIX -lib_tests += termios11 -lib_screens += termios11/termios11.scn -lib_docs += termios11/termios11.doc -termios11_SOURCES = termios11/init.c -termios11_SOURCES += termios04/termios_testdriver_intr.c -termios11_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_termios11) \ - $(support_includes) -endif -endif - -if TEST_top -lib_tests += top -lib_screens += top/top.scn -top_SOURCES = top/init.c top/task1.c top/task2.c top/task3.c \ - top/system.h -top_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_top) $(support_includes) -endif - -if TEST_ttest01 -lib_tests += ttest01 -lib_screens += ttest01/ttest01.scn -lib_docs += ttest01/ttest01.doc -ttest01_SOURCES = ttest01/init.c -ttest01_SOURCES += ttest01/test-assert.c -ttest01_SOURCES += ttest01/test-checks.c -ttest01_SOURCES += ttest01/test-destructor.c -ttest01_SOURCES += ttest01/test-eno.c -ttest01_SOURCES += ttest01/test-example.c -ttest01_SOURCES += ttest01/test-fixture.c -ttest01_SOURCES += ttest01/test-leak.c -ttest01_SOURCES += ttest01/test-log.c -ttest01_SOURCES += ttest01/test-malloc.c -ttest01_SOURCES += ttest01/test-plan.c -ttest01_SOURCES += ttest01/test-psx.c -ttest01_SOURCES += ttest01/test-rtems.c -ttest01_SOURCES += ttest01/test-simple.c -ttest01_SOURCES += ttest01/test-step.c -ttest01_SOURCES += ttest01/test-task-context.c -ttest01_SOURCES += ttest01/test-time.c -ttest01_SOURCES += ttest01/test-verbosity.c -ttest01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_ttest01) \ - $(support_includes) -endif - -if TEST_ttest02 -lib_tests += ttest02 -lib_screens += ttest02/ttest02.scn -lib_docs += ttest02/ttest02.doc -ttest02_SOURCES = ttest02/init.c -ttest02_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_ttest02) \ - $(support_includes) -endif - -if TEST_tztest -lib_tests += tztest -lib_screens += tztest/tztest.scn -lib_docs += tztest/tztest.doc -tztest_SOURCES = tztest/init.c -tztest_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_tztest) \ - $(support_includes) -endif - -if TEST_uid01 -lib_tests += uid01 -lib_docs += uid01/uid01.doc -uid01_SOURCES = uid01/init.c uid01/serial_mouse_config.c \ - uid01/msmouse.c termios04/termios_testdriver_intr.c -uid01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_uid01) \ - $(support_includes) -endif - -if TEST_unlink -lib_tests += unlink.norun -unlink_norun_SOURCES = POSIX/unlink.c -unlink_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_utf8proc01 -lib_tests += utf8proc01 -lib_screens += utf8proc01/utf8proc01.scn -lib_docs += utf8proc01/utf8proc01.doc -utf8proc01_SOURCES = utf8proc01/init.c -utf8proc01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_utf8proc01) \ - $(support_includes) -endif - -if TEST_vfork -lib_tests += vfork.norun -vfork_norun_SOURCES = POSIX/vfork.c -vfork_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_wait -lib_tests += wait.norun -wait_norun_SOURCES = POSIX/wait.c -wait_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_waitpid -lib_tests += waitpid.norun -waitpid_norun_SOURCES = POSIX/waitpid.c -waitpid_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_write -lib_tests += write.norun -write_norun_SOURCES = POSIX/write.c -write_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -if TEST_writev -lib_tests += writev.norun -writev_norun_SOURCES = POSIX/writev.c -writev_norun_LDADD = $(RTEMS_ROOT)cpukit/librtemsdefaultconfig.a $(LDADD) -endif - -noinst_PROGRAMS = $(lib_tests) diff --git a/testsuites/libtests/POSIX/calloc.c b/testsuites/libtests/POSIX/calloc.c index bd04faa800..a7537c8cc4 100644 --- a/testsuites/libtests/POSIX/calloc.c +++ b/testsuites/libtests/POSIX/calloc.c @@ -16,6 +16,8 @@ int main (void) { void *foo = calloc (42, 43); + int rc = (foo != NULL); + free(foo); - return (foo != NULL); + return rc; } diff --git a/testsuites/libtests/POSIX/free.c b/testsuites/libtests/POSIX/free.c index 8550eaa85c..246415ce65 100644 --- a/testsuites/libtests/POSIX/free.c +++ b/testsuites/libtests/POSIX/free.c @@ -12,9 +12,10 @@ #include <stdlib.h> +void* p; + int main (void) { - free((void *) 42); - + free(p); return 0; } diff --git a/testsuites/libtests/POSIX/readv.c b/testsuites/libtests/POSIX/readv.c index a980e9468c..6b0bf63f94 100644 --- a/testsuites/libtests/POSIX/readv.c +++ b/testsuites/libtests/POSIX/readv.c @@ -14,7 +14,7 @@ int main(void) { - struct iovec iov; + struct iovec iov = { 0 }; int count = 4; ssize_t ret; diff --git a/testsuites/libtests/POSIX/sigismember.c b/testsuites/libtests/POSIX/sigismember.c index ed980b70f0..f4c7d37cb2 100644 --- a/testsuites/libtests/POSIX/sigismember.c +++ b/testsuites/libtests/POSIX/sigismember.c @@ -14,7 +14,7 @@ int main(void) { - sigset_t set; + sigset_t set = { 0 }; int status; status = sigismember(&set, 21); diff --git a/testsuites/libtests/POSIX/sigprocmask.c b/testsuites/libtests/POSIX/sigprocmask.c index ba634e4660..25de0c28c7 100644 --- a/testsuites/libtests/POSIX/sigprocmask.c +++ b/testsuites/libtests/POSIX/sigprocmask.c @@ -15,7 +15,8 @@ int main(void) { int rc; - sigset_t set1, set2; + sigset_t set1 = { 0 }; + sigset_t set2 = { 0 }; rc = sigprocmask(SIG_BLOCK, &set1, &set2); (void) rc; diff --git a/testsuites/libtests/POSIX/writev.c b/testsuites/libtests/POSIX/writev.c index 853b8a8ced..5b5068db65 100644 --- a/testsuites/libtests/POSIX/writev.c +++ b/testsuites/libtests/POSIX/writev.c @@ -14,7 +14,7 @@ int main(void) { - struct iovec iov; + struct iovec iov = { 0 }; int count = 4; ssize_t ret; diff --git a/testsuites/libtests/block01/block01.doc b/testsuites/libtests/block01/block01.doc index 49bf1a132b..ff4d309f0a 100644 --- a/testsuites/libtests/block01/block01.doc +++ b/testsuites/libtests/block01/block01.doc @@ -1,13 +1,27 @@ -# Copyright (c) 2009 -# embedded brains GmbH -# Obere Lagerstr. 30 -# D-82178 Puchheim -# Germany -# <rtems@embedded-brains.de> +# SPDX-License-Identifier: BSD-2-Clause + +# Copyright (c) 2009 embedded brains GmbH & Co. KG +# +# 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. # -# 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. +# 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. diff --git a/testsuites/libtests/block01/init.c b/testsuites/libtests/block01/init.c index 16e0644534..7717b0b7e6 100644 --- a/testsuites/libtests/block01/init.c +++ b/testsuites/libtests/block01/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2009, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block02/block02.doc b/testsuites/libtests/block02/block02.doc index e92ae57578..e5b99ec8fe 100644 --- a/testsuites/libtests/block02/block02.doc +++ b/testsuites/libtests/block02/block02.doc @@ -1,13 +1,27 @@ -# Copyright (c) 2009 -# embedded brains GmbH -# Obere Lagerstr. 30 -# D-82178 Puchheim -# Germany -# <rtems@embedded-brains.de> +# SPDX-License-Identifier: BSD-2-Clause + +# Copyright (c) 2009 embedded brains GmbH & Co. KG +# +# 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. # -# 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. +# 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. diff --git a/testsuites/libtests/block02/init.c b/testsuites/libtests/block02/init.c index 73362fcc83..1e8d179d9d 100644 --- a/testsuites/libtests/block02/init.c +++ b/testsuites/libtests/block02/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2009, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block03/block03.doc b/testsuites/libtests/block03/block03.doc index 0106172d60..221c7dd816 100644 --- a/testsuites/libtests/block03/block03.doc +++ b/testsuites/libtests/block03/block03.doc @@ -1,13 +1,27 @@ -# Copyright (c) 2009 -# embedded brains GmbH -# Obere Lagerstr. 30 -# D-82178 Puchheim -# Germany -# <rtems@embedded-brains.de> +# SPDX-License-Identifier: BSD-2-Clause + +# Copyright (c) 2009 embedded brains GmbH & Co. KG +# +# 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. # -# 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. +# 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. diff --git a/testsuites/libtests/block03/init.c b/testsuites/libtests/block03/init.c index 9ab907c0d4..da2fa27589 100644 --- a/testsuites/libtests/block03/init.c +++ b/testsuites/libtests/block03/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2009, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block04/block04.doc b/testsuites/libtests/block04/block04.doc index 6449183ca0..2c05114636 100644 --- a/testsuites/libtests/block04/block04.doc +++ b/testsuites/libtests/block04/block04.doc @@ -1,13 +1,27 @@ -# Copyright (c) 2009 -# embedded brains GmbH -# Obere Lagerstr. 30 -# D-82178 Puchheim -# Germany -# <rtems@embedded-brains.de> +# SPDX-License-Identifier: BSD-2-Clause + +# Copyright (c) 2009 embedded brains GmbH & Co. KG +# +# 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. # -# 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. +# 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. diff --git a/testsuites/libtests/block04/init.c b/testsuites/libtests/block04/init.c index ff122a7c39..cdbab6e3fc 100644 --- a/testsuites/libtests/block04/init.c +++ b/testsuites/libtests/block04/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2009, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block05/block05.doc b/testsuites/libtests/block05/block05.doc index f0c47453a4..30a246bdf1 100644 --- a/testsuites/libtests/block05/block05.doc +++ b/testsuites/libtests/block05/block05.doc @@ -1,13 +1,27 @@ -# Copyright (c) 2009, 2010 -# embedded brains GmbH -# Obere Lagerstr. 30 -# D-82178 Puchheim -# Germany -# <rtems@embedded-brains.de> +# SPDX-License-Identifier: BSD-2-Clause + +# Copyright (C) 2009, 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 +# 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. # -# 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. +# 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. diff --git a/testsuites/libtests/block05/init.c b/testsuites/libtests/block05/init.c index 5d54c79c9f..e54fa9bd32 100644 --- a/testsuites/libtests/block05/init.c +++ b/testsuites/libtests/block05/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2009, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block06/block06.doc b/testsuites/libtests/block06/block06.doc index 3a09a59799..00efa32507 100644 --- a/testsuites/libtests/block06/block06.doc +++ b/testsuites/libtests/block06/block06.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright 2008-2014 Chris Johns (chrisj@rtems.org) # -# 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. diff --git a/testsuites/libtests/block06/init.c b/testsuites/libtests/block06/init.c index 3fa70c05b6..c4da28063d 100644 --- a/testsuites/libtests/block06/init.c +++ b/testsuites/libtests/block06/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright 2008 Chris Johns (chrisj@rtems.org) * - * 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. */ /** diff --git a/testsuites/libtests/block07/block07.doc b/testsuites/libtests/block07/block07.doc index f37e942dc7..18b2f9f656 100644 --- a/testsuites/libtests/block07/block07.doc +++ b/testsuites/libtests/block07/block07.doc @@ -1,13 +1,27 @@ -# Copyright (c) 2009 -# embedded brains GmbH -# Obere Lagerstr. 30 -# D-82178 Puchheim -# Germany -# <rtems@embedded-brains.de> +# SPDX-License-Identifier: BSD-2-Clause + +# Copyright (c) 2009 embedded brains GmbH & Co. KG +# +# 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. # -# 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. +# 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. diff --git a/testsuites/libtests/block07/init.c b/testsuites/libtests/block07/init.c index 19d53d10fe..a755cde987 100644 --- a/testsuites/libtests/block07/init.c +++ b/testsuites/libtests/block07/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2009, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block08/bdbuf_test1_1.c b/testsuites/libtests/block08/bdbuf_test1_1.c index 2c768c4194..4f0f6aeea4 100644 --- a/testsuites/libtests/block08/bdbuf_test1_1.c +++ b/testsuites/libtests/block08/bdbuf_test1_1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check the behaviour of rtems_bdbuf_read() function * with different reports from disk device driver. @@ -21,9 +23,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test1_2.c b/testsuites/libtests/block08/bdbuf_test1_2.c index f0b8d8f666..498da4c9f1 100644 --- a/testsuites/libtests/block08/bdbuf_test1_2.c +++ b/testsuites/libtests/block08/bdbuf_test1_2.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_read() handles two readers waiting * for a buffer with the same block number in cases when disk device @@ -23,9 +25,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test1_3.c b/testsuites/libtests/block08/bdbuf_test1_3.c index 95d7047d4a..a6d393fcaa 100644 --- a/testsuites/libtests/block08/bdbuf_test1_3.c +++ b/testsuites/libtests/block08/bdbuf_test1_3.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_read() handles two readers waiting * for a buffer with the same block number in cases when disk device @@ -24,9 +26,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test1_4.c b/testsuites/libtests/block08/bdbuf_test1_4.c index 232316fca3..1428321948 100644 --- a/testsuites/libtests/block08/bdbuf_test1_4.c +++ b/testsuites/libtests/block08/bdbuf_test1_4.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_read() handles two readers waiting * for a buffer with the same block number in cases when disk device @@ -21,9 +23,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test1_5.c b/testsuites/libtests/block08/bdbuf_test1_5.c index 947ce0ca7c..edb7c12beb 100644 --- a/testsuites/libtests/block08/bdbuf_test1_5.c +++ b/testsuites/libtests/block08/bdbuf_test1_5.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_read() handles read request * for a buffer that is owned by an application. @@ -20,9 +22,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test2_1.c b/testsuites/libtests/block08/bdbuf_test2_1.c index 748e3d3b15..571f63b559 100644 --- a/testsuites/libtests/block08/bdbuf_test2_1.c +++ b/testsuites/libtests/block08/bdbuf_test2_1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_read() and rtems_bdbuf_release_modified() * coexist. rtems_bdbuf_read() is blocked when required buffer is being @@ -23,9 +25,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test2_2.c b/testsuites/libtests/block08/bdbuf_test2_2.c index 997bd490bb..8ee84f016e 100644 --- a/testsuites/libtests/block08/bdbuf_test2_2.c +++ b/testsuites/libtests/block08/bdbuf_test2_2.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_read() and rtems_bdbuf_release_modified() * coexist. rtems_bdbuf_read() is blocked when required buffer is being @@ -26,9 +28,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test3_1.c b/testsuites/libtests/block08/bdbuf_test3_1.c index efe74b62ba..eaa8d757be 100644 --- a/testsuites/libtests/block08/bdbuf_test3_1.c +++ b/testsuites/libtests/block08/bdbuf_test3_1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how read/release work in case of only one buffer in ready list. * @@ -14,9 +16,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test3_2.c b/testsuites/libtests/block08/bdbuf_test3_2.c index 35e6dc8527..f411e957fe 100644 --- a/testsuites/libtests/block08/bdbuf_test3_2.c +++ b/testsuites/libtests/block08/bdbuf_test3_2.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check that when there are some tasks waiting for an available * buffer only one of them get a buffer after some other task releases one. @@ -15,9 +17,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test3_3.c b/testsuites/libtests/block08/bdbuf_test3_3.c index 3445b15723..0273b3cd45 100644 --- a/testsuites/libtests/block08/bdbuf_test3_3.c +++ b/testsuites/libtests/block08/bdbuf_test3_3.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how read/release work in case of only one buffer in ready list. * @@ -20,9 +22,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test4_1.c b/testsuites/libtests/block08/bdbuf_test4_1.c index ac1805da84..3dc36909c2 100644 --- a/testsuites/libtests/block08/bdbuf_test4_1.c +++ b/testsuites/libtests/block08/bdbuf_test4_1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_sync() works. * @@ -16,9 +18,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test4_2.c b/testsuites/libtests/block08/bdbuf_test4_2.c index 122eb7ab56..6c94740793 100644 --- a/testsuites/libtests/block08/bdbuf_test4_2.c +++ b/testsuites/libtests/block08/bdbuf_test4_2.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_sync() works. * @@ -17,9 +19,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_test4_3.c b/testsuites/libtests/block08/bdbuf_test4_3.c index 0c2dd68769..4d15c69b4b 100644 --- a/testsuites/libtests/block08/bdbuf_test4_3.c +++ b/testsuites/libtests/block08/bdbuf_test4_3.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Check how rtems_bdbuf_sync() works. * @@ -15,9 +17,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_tests.c b/testsuites/libtests/block08/bdbuf_tests.c index 8cf0111dbc..549246b034 100644 --- a/testsuites/libtests/block08/bdbuf_tests.c +++ b/testsuites/libtests/block08/bdbuf_tests.c @@ -1,12 +1,31 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Implementation of auxiliary functions of bdbuf tests. * * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/bdbuf_tests.h b/testsuites/libtests/block08/bdbuf_tests.h index eea2661480..626c60001a 100644 --- a/testsuites/libtests/block08/bdbuf_tests.h +++ b/testsuites/libtests/block08/bdbuf_tests.h @@ -1,12 +1,31 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Common declarations of bdbuf tests. * * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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. */ #ifndef BDBUF_TESTS_H diff --git a/testsuites/libtests/block08/init.c b/testsuites/libtests/block08/init.c index 83eaf6d534..5d4b39ac02 100644 --- a/testsuites/libtests/block08/init.c +++ b/testsuites/libtests/block08/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Init * * This routine is the initialization task for this test program. @@ -10,9 +12,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block08/system.h b/testsuites/libtests/block08/system.h index 91227539dd..155f93ef20 100644 --- a/testsuites/libtests/block08/system.h +++ b/testsuites/libtests/block08/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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. */ #include <rtems.h> diff --git a/testsuites/libtests/block08/test_disk.c b/testsuites/libtests/block08/test_disk.c index 27aea17d27..64d42acd91 100644 --- a/testsuites/libtests/block08/test_disk.c +++ b/testsuites/libtests/block08/test_disk.c @@ -1,12 +1,31 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /*! @file * @brief Test disk block device implementation. * * Copyright (C) 2010 OKTET Labs, St.-Petersburg, Russia * Author: Oleg Kravtsov <Oleg.Kravtsov@oktetlabs.ru> * - * 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/libtests/block09/block09.doc b/testsuites/libtests/block09/block09.doc index debfb93ad9..ffe672eb1d 100644 --- a/testsuites/libtests/block09/block09.doc +++ b/testsuites/libtests/block09/block09.doc @@ -1,13 +1,27 @@ -# Copyright (c) 2010 -# embedded brains GmbH -# Obere Lagerstr. 30 -# D-82178 Puchheim -# Germany -# <rtems@embedded-brains.de> +# SPDX-License-Identifier: BSD-2-Clause + +# 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 +# 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. # -# 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. +# 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. diff --git a/testsuites/libtests/block09/init.c b/testsuites/libtests/block09/init.c index 1dfce2c251..2456952164 100644 --- a/testsuites/libtests/block09/init.c +++ b/testsuites/libtests/block09/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2009, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block10/block10.doc b/testsuites/libtests/block10/block10.doc index 3199ed5596..7020cc56c0 100644 --- a/testsuites/libtests/block10/block10.doc +++ b/testsuites/libtests/block10/block10.doc @@ -1,13 +1,27 @@ -# Copyright (c) 2010 -# embedded brains GmbH -# Obere Lagerstr. 30 -# D-82178 Puchheim -# Germany -# <rtems@embedded-brains.de> +# SPDX-License-Identifier: BSD-2-Clause + +# 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 +# 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. # -# 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. +# 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. diff --git a/testsuites/libtests/block10/init.c b/testsuites/libtests/block10/init.c index 1e57a65eb1..693a8a8908 100644 --- a/testsuites/libtests/block10/init.c +++ b/testsuites/libtests/block10/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2010, 2018 embedded brains GmbH. + * Copyright (C) 2010, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * D-82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block11/init.c b/testsuites/libtests/block11/init.c index 8539cc63a8..5d442e768f 100644 --- a/testsuites/libtests/block11/init.c +++ b/testsuites/libtests/block11/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -7,17 +9,28 @@ */ /* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block12/init.c b/testsuites/libtests/block12/init.c index 6326093e34..ad51974fec 100644 --- a/testsuites/libtests/block12/init.c +++ b/testsuites/libtests/block12/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2012, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block13/init.c b/testsuites/libtests/block13/init.c index c769c6fb93..c91ce8818d 100644 --- a/testsuites/libtests/block13/init.c +++ b/testsuites/libtests/block13/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2012, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block14/block14.scn b/testsuites/libtests/block14/block14.scn index 7170522579..cf5518adfd 100644 --- a/testsuites/libtests/block14/block14.scn +++ b/testsuites/libtests/block14/block14.scn @@ -6,19 +6,30 @@ action 3 action 4 action 5 action 6 +action 7 +action 8 +action 9 +action 10 +action 11 +action 12 +action 13 +action 14 +action 15 ------------------------------------------------------------------------------- DEVICE STATISTICS ----------------------+-------------------------------------------------------- MEDIA BLOCK SIZE | 0 MEDIA BLOCK COUNT | 1 BLOCK SIZE | 2 - READ HITS | 2 - READ MISSES | 3 - READ AHEAD TRANSFERS | 2 - READ BLOCKS | 5 + READ HITS | 4 + READ MISSES | 7 + READ AHEAD TRANSFERS | 6 + READ AHEAD PEEKS | 3 + READ BLOCKS | 13 READ ERRORS | 1 WRITE TRANSFERS | 2 WRITE BLOCKS | 2 WRITE ERRORS | 1 ----------------------+-------------------------------------------------------- + *** END OF TEST BLOCK 14 *** diff --git a/testsuites/libtests/block14/init.c b/testsuites/libtests/block14/init.c index b4e73aadc9..ba0291d314 100644 --- a/testsuites/libtests/block14/init.c +++ b/testsuites/libtests/block14/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2012, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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 @@ -29,9 +42,9 @@ const char rtems_test_name[] = "BLOCK 14"; -#define ACTION_COUNT 7 +#define ACTION_COUNT 16 -#define BLOCK_COUNT 6 +#define BLOCK_COUNT 14 #define DISK_PATH "/disk" @@ -42,50 +55,104 @@ typedef struct { rtems_blkdev_bnum block, rtems_bdbuf_buffer **bd_ptr ); + void (*peek)( + rtems_disk_device *dd, + rtems_blkdev_bnum block, + uint32_t nr_blocks + ); rtems_status_code expected_get_status; rtems_status_code (*release)(rtems_bdbuf_buffer *bd); } test_action; static const test_action actions [ACTION_COUNT] = { - { 0, rtems_bdbuf_read, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, - { 1, rtems_bdbuf_read, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, - { 2, rtems_bdbuf_read, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, - { 0, rtems_bdbuf_read, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, - { 4, rtems_bdbuf_get, RTEMS_SUCCESSFUL, rtems_bdbuf_sync }, - { 5, rtems_bdbuf_read, RTEMS_IO_ERROR, rtems_bdbuf_release }, - { 5, rtems_bdbuf_get, RTEMS_SUCCESSFUL, rtems_bdbuf_sync } + /* normal read ahead */ + { 0, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + { 1, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + { 2, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + + /* re-read a cached block */ + { 0, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + + /* cause some writes */ + { 4, rtems_bdbuf_get, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_sync }, + { 5, rtems_bdbuf_read, NULL, RTEMS_IO_ERROR, rtems_bdbuf_release }, + { 5, rtems_bdbuf_get, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_sync }, + + /* interrupt normal read ahead with a peek */ + { 9, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + { 13, NULL, rtems_bdbuf_peek, 0, NULL }, + { 10, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + { 11, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + { 12, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + + /* peek with hit */ + { 6, NULL, rtems_bdbuf_peek, 0, NULL }, + { 6, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, + + /* (wrong) peek with reading different block */ + { 8, NULL, rtems_bdbuf_peek, 0, NULL }, + { 7, rtems_bdbuf_read, NULL, RTEMS_SUCCESSFUL, rtems_bdbuf_release }, }; -#define STATS(a, b, c, d, e, f, g, h) \ +#define STATS(a, b, c, d, e, f, g, h, i) \ { \ .read_hits = a, \ .read_misses = b, \ .read_ahead_transfers = c, \ - .read_blocks = d, \ - .read_errors = e, \ - .write_transfers = f, \ - .write_blocks = g, \ - .write_errors = h \ + .read_ahead_peeks = d, \ + .read_blocks = e, \ + .read_errors = f, \ + .write_transfers = g, \ + .write_blocks = h, \ + .write_errors = i \ } static const rtems_blkdev_stats expected_stats [ACTION_COUNT] = { - STATS(0, 1, 0, 1, 0, 0, 0, 0), - STATS(0, 2, 1, 3, 0, 0, 0, 0), - STATS(1, 2, 2, 4, 0, 0, 0, 0), - STATS(2, 2, 2, 4, 0, 0, 0, 0), - STATS(2, 2, 2, 4, 0, 1, 1, 0), - STATS(2, 3, 2, 5, 1, 1, 1, 0), - STATS(2, 3, 2, 5, 1, 2, 2, 1) + STATS(0, 1, 0, 0, 1, 0, 0, 0, 0), + STATS(0, 2, 1, 0, 3, 0, 0, 0, 0), + STATS(1, 2, 2, 0, 4, 0, 0, 0, 0), + + STATS(2, 2, 2, 0, 4, 0, 0, 0, 0), + + STATS(2, 2, 2, 0, 4, 0, 1, 1, 0), + STATS(2, 3, 2, 0, 5, 1, 1, 1, 0), + STATS(2, 3, 2, 0, 5, 1, 2, 2, 1), + + STATS(2, 4, 2, 0, 6, 1, 2, 2, 1), + STATS(2, 4, 3, 1, 7, 1, 2, 2, 1), + STATS(2, 5, 3, 1, 8, 1, 2, 2, 1), + STATS(2, 6, 4, 1, 10, 1, 2, 2, 1), + STATS(3, 6, 4, 1, 10, 1, 2, 2, 1), + + STATS(3, 6, 5, 2, 11, 1, 2, 2, 1), + STATS(4, 6, 5, 2, 11, 1, 2, 2, 1), + + STATS(4, 6, 6, 3, 12, 1, 2, 2, 1), + STATS(4, 7, 6, 3, 13, 1, 2, 2, 1), }; static const int expected_block_access_counts [ACTION_COUNT] [BLOCK_COUNT] = { - { 1, 0, 0, 0, 0, 0 }, - { 1, 1, 1, 0, 0, 0 }, - { 1, 1, 1, 1, 0, 0 }, - { 1, 1, 1, 1, 0, 0 }, - { 1, 1, 1, 1, 1, 0 }, - { 1, 1, 1, 1, 1, 1 }, - { 1, 1, 1, 1, 1, 2 } + { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + + { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + + { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0 }, + + { 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 0, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 0, 0, 0, 1 }, + { 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 1, 0, 0, 1 }, + { 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 1, 1, 1, 1 }, + { 1, 1, 1, 1, 1, 2, 0, 0, 0, 1, 1, 1, 1, 1 }, + + { 1, 1, 1, 1, 1, 2, 1, 0, 0, 1, 1, 1, 1, 1 }, + { 1, 1, 1, 1, 1, 2, 1, 0, 0, 1, 1, 1, 1, 1 }, + + { 1, 1, 1, 1, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1 }, + { 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1 }, }; static int block_access_counts [BLOCK_COUNT]; @@ -126,16 +193,22 @@ static void test_actions(rtems_disk_device *dd) for (i = 0; i < ACTION_COUNT; ++i) { const test_action *action = &actions [i]; - rtems_status_code sc; + rtems_status_code sc = RTEMS_INVALID_ADDRESS; rtems_bdbuf_buffer *bd; rtems_blkdev_stats stats; printf("action %i\n", i); - sc = (*action->get)(dd, action->block, &bd); - rtems_test_assert(sc == action->expected_get_status); + if (action->get != NULL) { + sc = (*action->get)(dd, action->block, &bd); + rtems_test_assert(sc == action->expected_get_status); + } + + if (action->peek != NULL) { + (*action->peek)(dd, action->block, 1); + } - if (sc == RTEMS_SUCCESSFUL) { + if (sc == RTEMS_SUCCESSFUL && action->release != NULL) { sc = (*action->release)(bd); rtems_test_assert(sc == RTEMS_SUCCESSFUL); } diff --git a/testsuites/libtests/block15/init.c b/testsuites/libtests/block15/init.c index 631a841f5d..9409061631 100644 --- a/testsuites/libtests/block15/init.c +++ b/testsuites/libtests/block15/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block16/init.c b/testsuites/libtests/block16/init.c index 6d6695ef1f..d800895fee 100644 --- a/testsuites/libtests/block16/init.c +++ b/testsuites/libtests/block16/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/block17/init.c b/testsuites/libtests/block17/init.c index cbd918c7b6..bf670f679d 100644 --- a/testsuites/libtests/block17/init.c +++ b/testsuites/libtests/block17/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2013, 2018 embedded brains GmbH. All rights reserved. + * Copyright (C) 2013, 2018 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/bspcmdline01/bspcmdline01.doc b/testsuites/libtests/bspcmdline01/bspcmdline01.doc index 51e747cf67..9cc3eed704 100644 --- a/testsuites/libtests/bspcmdline01/bspcmdline01.doc +++ b/testsuites/libtests/bspcmdline01/bspcmdline01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # 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. # This file describes the directives and concepts tested by this test set. diff --git a/testsuites/libtests/bspcmdline01/init.c b/testsuites/libtests/bspcmdline01/init.c index 243c7aad2a..11f37d369a 100644 --- a/testsuites/libtests/bspcmdline01/init.c +++ b/testsuites/libtests/bspcmdline01/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/libtests/capture01/capture01.doc b/testsuites/libtests/capture01/capture01.doc index c3d2e566d8..b42dab2757 100644 --- a/testsuites/libtests/capture01/capture01.doc +++ b/testsuites/libtests/capture01/capture01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 1989-1999. # 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 is a non-ineractive test of the capture engine. This test is based diff --git a/testsuites/libtests/capture01/init.c b/testsuites/libtests/capture01/init.c index 5c6a092ef2..3191ab62eb 100644 --- a/testsuites/libtests/capture01/init.c +++ b/testsuites/libtests/capture01/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 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. */ #define CONFIGURE_INIT diff --git a/testsuites/libtests/capture01/system.h b/testsuites/libtests/capture01/system.h index 620b7b477f..48e1f525fb 100644 --- a/testsuites/libtests/capture01/system.h +++ b/testsuites/libtests/capture01/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1997. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may 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. */ #include <rtems.h> diff --git a/testsuites/libtests/capture01/test1.c b/testsuites/libtests/capture01/test1.c index f1a2133d6b..a0098fa183 100644 --- a/testsuites/libtests/capture01/test1.c +++ b/testsuites/libtests/capture01/test1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Test1 * * This test uses creates a number of tasks so the capture engine @@ -10,9 +12,26 @@ * COPYRIGHT (c) 1989-1997. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may 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/libtests/complex/complex.doc b/testsuites/libtests/complex/complex.doc index 1de63d0981..815d86cadf 100644 --- a/testsuites/libtests/complex/complex.doc +++ b/testsuites/libtests/complex/complex.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 2014. # On-Line Applications Research Corporation (OAR). # Cynthia Rempel <cynthia@rtems.org> -# 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. diff --git a/testsuites/libtests/complex/init.c b/testsuites/libtests/complex/init.c index 185b38f8f3..442238e79e 100644 --- a/testsuites/libtests/complex/init.c +++ b/testsuites/libtests/complex/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Init * * This routine is the initialization task for this test program. @@ -13,9 +15,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/configure.ac b/testsuites/libtests/configure.ac deleted file mode 100644 index 2fbcb61622..0000000000 --- a/testsuites/libtests/configure.ac +++ /dev/null @@ -1,240 +0,0 @@ -## Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.69]) -AC_INIT([rtems-c-src-tests-libtests],[_RTEMS_VERSION],[https://devel.rtems.org/newticket]) -AC_CONFIG_SRCDIR([cpuuse]) -AC_CONFIG_HEADER([config.h]) -RTEMS_TOP([../..],[..]) -RTEMS_SOURCE_TOP -RTEMS_BUILD_TOP - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign subdir-objects 1.12.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_CXX - -RTEMS_ENV_RTEMSBSP - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET - -RTEMS_PROG_CXX_FOR_TARGET - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) -RTEMS_CHECK_CXX(RTEMS_BSP) -RTEMS_CHECK_CPUOPTS([RTEMS_NETWORKING]) -RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API]) - -AC_PATH_PROG([PAX],[pax],no) -AC_PATH_PROG([GZIP],[gzip],no) -AC_PATH_PROG([XZ],[xz],no) - -AS_IF([test "x$PAX" = "xno"],[ - AC_MSG_ERROR([pax is missing.]) -]) - -AM_CONDITIONAL(TARTESTS,test -n "$PAX" && test -n "$GZIP") -AM_CONDITIONAL(TARTEST_XZ,test -n "$XZ") - -AM_CONDITIONAL(HAS_CXX,test "$rtems_cv_HAS_CPLUSPLUS" = "yes") -AM_CONDITIONAL([HAS_COMPLEX],[test "$ac_cv_header_complex_h" = yes]) -AM_CONDITIONAL(NETTESTS,test "$rtems_cv_RTEMS_NETWORKING" = "yes") -AM_CONDITIONAL(HAS_POSIX,test x"${rtems_cv_RTEMS_POSIX_API}" = x"yes") - -# Must match the list in cpukit. -AC_MSG_CHECKING([whether CPU supports libdl]) -case $RTEMS_CPU in - arm | i386 | m68k | mips | moxie | powerpc | riscv | sparc) - TEST_LIBDL=yes ;; - # bfin has an issue to resolve with libdl. See ticket #2252 - bfin) - HAVE_LIBDL=no ;; - # lm32 has an issue to resolve with libdl. See ticket #2283 - lm32) - HAVE_LIBDL=no ;; - # v850 has an issue to resolve with libdl. See ticket #2260 - v850) - HAVE_LIBDL=no ;; - *) - TEST_LIBDL=no ;; -esac -AC_MSG_RESULT([$TEST_LIBDL]) - -AS_IF([test x"$TEST_LIBDL" = x"yes"],[ - AC_CHECK_PROG(RTEMS_LD_CHECK,rtems-ld,yes) - if test x"$RTEMS_LD_CHECK" != x"yes" ; then - TEST_LIBDL=no - fi - AC_CHECK_PROG(RTEMS_SYMS_CHECK,rtems-syms,yes) - if test x"$RTEMS_SYMS_CHECK" != x"yes" ; then - TEST_LIBDL=no - fi -]) - -AM_CONDITIONAL(DLTESTS,[test x"$TEST_LIBDL" = x"yes"]) - -# Must match the list in cpukit. -AC_MSG_CHECKING([whether CPU supports libdebugger]) -case $RTEMS_CPU in - arm | i386) - TEST_LIBDEBUGGER=yes ;; - *) - TEST_LIBDEBUGGER=no ;; -esac -AC_MSG_RESULT([$TEST_LIBDEBUGGER]) -AM_CONDITIONAL(DEBUGGERTESTS,[test x"$TEST_LIBDEBUGGER" = x"yes"]) - -# BSP Test configuration -RTEMS_TEST_CHECK([block01]) -RTEMS_TEST_CHECK([block02]) -RTEMS_TEST_CHECK([block03]) -RTEMS_TEST_CHECK([block04]) -RTEMS_TEST_CHECK([block05]) -RTEMS_TEST_CHECK([block06]) -RTEMS_TEST_CHECK([block07]) -RTEMS_TEST_CHECK([block08]) -RTEMS_TEST_CHECK([block09]) -RTEMS_TEST_CHECK([block10]) -RTEMS_TEST_CHECK([block11]) -RTEMS_TEST_CHECK([block12]) -RTEMS_TEST_CHECK([block13]) -RTEMS_TEST_CHECK([block14]) -RTEMS_TEST_CHECK([block15]) -RTEMS_TEST_CHECK([block16]) -RTEMS_TEST_CHECK([block17]) -RTEMS_TEST_CHECK([bspcmdline01]) -RTEMS_TEST_CHECK([calloc]) -RTEMS_TEST_CHECK([capture01]) -RTEMS_TEST_CHECK([clock_gettime]) -RTEMS_TEST_CHECK([close]) -RTEMS_TEST_CHECK([complex]) -RTEMS_TEST_CHECK([cpuuse]) -RTEMS_TEST_CHECK([crypt01]) -RTEMS_TEST_CHECK([debugger01]) -RTEMS_TEST_CHECK([defaultconfig01]) -RTEMS_TEST_CHECK([devfs01]) -RTEMS_TEST_CHECK([devfs04]) -RTEMS_TEST_CHECK([deviceio01]) -RTEMS_TEST_CHECK([devnullfatal01]) -RTEMS_TEST_CHECK([dl01]) -RTEMS_TEST_CHECK([dl02]) -RTEMS_TEST_CHECK([dl03]) -RTEMS_TEST_CHECK([dl04]) -RTEMS_TEST_CHECK([dl05]) -RTEMS_TEST_CHECK([dl06]) -RTEMS_TEST_CHECK([dl07]) -RTEMS_TEST_CHECK([dl08]) -RTEMS_TEST_CHECK([dl09]) -RTEMS_TEST_CHECK([dl10]) -RTEMS_TEST_CHECK([dumpbuf01]) -RTEMS_TEST_CHECK([dup2]) -RTEMS_TEST_CHECK([exit01]) -RTEMS_TEST_CHECK([exit02]) -RTEMS_TEST_CHECK([fcntl]) -RTEMS_TEST_CHECK([flashdisk01]) -RTEMS_TEST_CHECK([flockfile]) -RTEMS_TEST_CHECK([fork]) -RTEMS_TEST_CHECK([free]) -RTEMS_TEST_CHECK([fstat]) -RTEMS_TEST_CHECK([ftp01]) -RTEMS_TEST_CHECK([ftrylockfile]) -RTEMS_TEST_CHECK([funlockfile]) -RTEMS_TEST_CHECK([getentropy01]) -RTEMS_TEST_CHECK([getlogin]) -RTEMS_TEST_CHECK([getpwnam]) -RTEMS_TEST_CHECK([getpwuid]) -RTEMS_TEST_CHECK([gettimeofday]) -RTEMS_TEST_CHECK([getuid]) -RTEMS_TEST_CHECK([gxx01]) -RTEMS_TEST_CHECK([heapwalk]) -RTEMS_TEST_CHECK([htonl]) -RTEMS_TEST_CHECK([i2c01]) -RTEMS_TEST_CHECK([iconv]) -RTEMS_TEST_CHECK([iconv_close]) -RTEMS_TEST_CHECK([iconv_open]) -RTEMS_TEST_CHECK([kill]) -RTEMS_TEST_CHECK([libfdt01]) -RTEMS_TEST_CHECK([longjmp]) -RTEMS_TEST_CHECK([lseek]) -RTEMS_TEST_CHECK([lstat]) -RTEMS_TEST_CHECK([malloc]) -RTEMS_TEST_CHECK([malloc02]) -RTEMS_TEST_CHECK([malloc03]) -RTEMS_TEST_CHECK([malloc04]) -RTEMS_TEST_CHECK([malloctest]) -RTEMS_TEST_CHECK([math]) -RTEMS_TEST_CHECK([mathf]) -RTEMS_TEST_CHECK([mathl]) -RTEMS_TEST_CHECK([md501]) -RTEMS_TEST_CHECK([mghttpd01]) -RTEMS_TEST_CHECK([monitor]) -RTEMS_TEST_CHECK([monitor02]) -RTEMS_TEST_CHECK([mouse01]) -RTEMS_TEST_CHECK([nanosleep]) -RTEMS_TEST_CHECK([networking01]) -RTEMS_TEST_CHECK([newlib01]) -RTEMS_TEST_CHECK([open]) -RTEMS_TEST_CHECK([pipe]) -RTEMS_TEST_CHECK([posix_memalign]) -RTEMS_TEST_CHECK([putenvtest]) -RTEMS_TEST_CHECK([pwdgrp01]) -RTEMS_TEST_CHECK([pwdgrp02]) -RTEMS_TEST_CHECK([rbheap01]) -RTEMS_TEST_CHECK([read]) -RTEMS_TEST_CHECK([readv]) -RTEMS_TEST_CHECK([realloc]) -RTEMS_TEST_CHECK([record01]) -RTEMS_TEST_CHECK([record02]) -RTEMS_TEST_CHECK([rtmonuse]) -RTEMS_TEST_CHECK([setjmp]) -RTEMS_TEST_CHECK([sha]) -RTEMS_TEST_CHECK([shell01]) -RTEMS_TEST_CHECK([sigaddset]) -RTEMS_TEST_CHECK([sigdelset]) -RTEMS_TEST_CHECK([sigemptyset]) -RTEMS_TEST_CHECK([sigfillset]) -RTEMS_TEST_CHECK([sigismember]) -RTEMS_TEST_CHECK([sigprocmask]) -RTEMS_TEST_CHECK([sparsedisk01]) -RTEMS_TEST_CHECK([spi01]) -RTEMS_TEST_CHECK([stackchk]) -RTEMS_TEST_CHECK([stackchk01]) -RTEMS_TEST_CHECK([stat]) -RTEMS_TEST_CHECK([stringto01]) -RTEMS_TEST_CHECK([syscall01]) -RTEMS_TEST_CHECK([tar01]) -RTEMS_TEST_CHECK([tar02]) -RTEMS_TEST_CHECK([tar03]) -RTEMS_TEST_CHECK([telnetd01]) -RTEMS_TEST_CHECK([termios]) -RTEMS_TEST_CHECK([termios01]) -RTEMS_TEST_CHECK([termios02]) -RTEMS_TEST_CHECK([termios03]) -RTEMS_TEST_CHECK([termios04]) -RTEMS_TEST_CHECK([termios05]) -RTEMS_TEST_CHECK([termios06]) -RTEMS_TEST_CHECK([termios07]) -RTEMS_TEST_CHECK([termios08]) -RTEMS_TEST_CHECK([termios09]) -RTEMS_TEST_CHECK([termios10]) -RTEMS_TEST_CHECK([termios11]) -RTEMS_TEST_CHECK([top]) -RTEMS_TEST_CHECK([ttest01]) -RTEMS_TEST_CHECK([ttest02]) -RTEMS_TEST_CHECK([tztest]) -RTEMS_TEST_CHECK([uid01]) -RTEMS_TEST_CHECK([unlink]) -RTEMS_TEST_CHECK([utf8proc01]) -RTEMS_TEST_CHECK([vfork]) -RTEMS_TEST_CHECK([wait]) -RTEMS_TEST_CHECK([waitpid]) -RTEMS_TEST_CHECK([write]) -RTEMS_TEST_CHECK([writev]) - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/testsuites/libtests/cpuuse/init.c b/testsuites/libtests/cpuuse/init.c index 42dcaa505e..d8d5a7595a 100644 --- a/testsuites/libtests/cpuuse/init.c +++ b/testsuites/libtests/cpuuse/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * This is a clone of sp04 which has been modified to use the cpu monitoring * library. @@ -10,9 +12,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/cpuuse/system.h b/testsuites/libtests/cpuuse/system.h index 28a6e56510..6ee404dd9a 100644 --- a/testsuites/libtests/cpuuse/system.h +++ b/testsuites/libtests/cpuuse/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <bsp.h> diff --git a/testsuites/libtests/cpuuse/task1.c b/testsuites/libtests/cpuuse/task1.c index 969d816859..e326e143a7 100644 --- a/testsuites/libtests/cpuuse/task1.c +++ b/testsuites/libtests/cpuuse/task1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Task_1 * * This test serves as a test task. It verifies timeslicing activities @@ -11,9 +13,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/cpuuse/task2.c b/testsuites/libtests/cpuuse/task2.c index 166192966f..63046c7775 100644 --- a/testsuites/libtests/cpuuse/task2.c +++ b/testsuites/libtests/cpuuse/task2.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Task_2 * * This routine serves as a test task. It is just a CPU bound task @@ -11,9 +13,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/cpuuse/task3.c b/testsuites/libtests/cpuuse/task3.c index 77b6206e6b..ae40b14b66 100644 --- a/testsuites/libtests/cpuuse/task3.c +++ b/testsuites/libtests/cpuuse/task3.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Task_3 * * This routine serves as a test task. It is just a CPU bound task @@ -11,9 +13,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/cpuuse/tswitch.c b/testsuites/libtests/cpuuse/tswitch.c index 09963739fc..502322076e 100644 --- a/testsuites/libtests/cpuuse/tswitch.c +++ b/testsuites/libtests/cpuuse/tswitch.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Task_switch * * This routine is the tswitch user extension. It determines which @@ -13,9 +15,26 @@ * 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/libtests/crypt01/init.c b/testsuites/libtests/crypt01/init.c index 527a151034..37966a0200 100644 --- a/testsuites/libtests/crypt01/init.c +++ b/testsuites/libtests/crypt01/init.c @@ -1,13 +1,7 @@ /* * Copyright (c) 2011 The FreeBSD Project. All rights reserved. * - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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 @@ -42,6 +36,8 @@ #include <crypt.h> #include <string.h> +#include <rtems/stackchk.h> + #include "tmacros.h" const char rtems_test_name[] = "CRYPT 1"; @@ -240,18 +236,20 @@ static void Init(rtems_task_argument arg) test_sha512(); test_generic(); + rtems_test_assert(!rtems_stack_checker_is_blown()); TEST_END(); rtems_test_exit(0); } #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER +#define CONFIGURE_STACK_CHECKER_ENABLED #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION -#define CONFIGURE_INIT_TASK_STACK_SIZE (2 * RTEMS_MINIMUM_STACK_SIZE) +#define CONFIGURE_INIT_TASK_STACK_SIZE (8 * RTEMS_MINIMUM_STACK_SIZE) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/libtests/debugger01/debugger01.doc b/testsuites/libtests/debugger01/debugger01.doc index 2cdd48bf4d..0313882564 100644 --- a/testsuites/libtests/debugger01/debugger01.doc +++ b/testsuites/libtests/debugger01/debugger01.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2016 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/debugger01/init.c b/testsuites/libtests/debugger01/init.c index 9fb85007de..7a4eecd965 100644 --- a/testsuites/libtests/debugger01/init.c +++ b/testsuites/libtests/debugger01/init.c @@ -1,11 +1,30 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Debugger test. * * Copyright (c) 2016 Chris Johns (chrisj@rtems.org) * - * 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/libtests/debugger01/remote.c b/testsuites/libtests/debugger01/remote.c index 3b302284a8..f69442d8c1 100644 --- a/testsuites/libtests/debugger01/remote.c +++ b/testsuites/libtests/debugger01/remote.c @@ -1,11 +1,30 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Debugger test remote. * * Copyright (c) 2016 Chris Johns (chrisj@rtems.org) * - * 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/libtests/debugger01/system.h b/testsuites/libtests/debugger01/system.h index 5ec19652f3..0ed05cd216 100644 --- a/testsuites/libtests/debugger01/system.h +++ b/testsuites/libtests/debugger01/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <bsp.h> diff --git a/testsuites/libtests/defaultconfig01/init.c b/testsuites/libtests/defaultconfig01/init.c index 3ebd5ac1b9..b8d702c96f 100644 --- a/testsuites/libtests/defaultconfig01/init.c +++ b/testsuites/libtests/defaultconfig01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/devfs01/devfs01.doc b/testsuites/libtests/devfs01/devfs01.doc index 9503ce1056..dd5a48fdf3 100644 --- a/testsuites/libtests/devfs01/devfs01.doc +++ b/testsuites/libtests/devfs01/devfs01.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. diff --git a/testsuites/libtests/devfs01/init.c b/testsuites/libtests/devfs01/init.c index 193c7641db..b467bbd998 100644 --- a/testsuites/libtests/devfs01/init.c +++ b/testsuites/libtests/devfs01/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 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testsuites/libtests/devfs04/devfs04.doc b/testsuites/libtests/devfs04/devfs04.doc index abd578de47..2f512e50e1 100644 --- a/testsuites/libtests/devfs04/devfs04.doc +++ b/testsuites/libtests/devfs04/devfs04.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. diff --git a/testsuites/libtests/devfs04/init.c b/testsuites/libtests/devfs04/init.c index a7549abdad..ca5269dcdd 100644 --- a/testsuites/libtests/devfs04/init.c +++ b/testsuites/libtests/devfs04/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/libtests/devfs04/test_driver.c b/testsuites/libtests/devfs04/test_driver.c index bd4b40af9a..b3a8339d83 100644 --- a/testsuites/libtests/devfs04/test_driver.c +++ b/testsuites/libtests/devfs04/test_driver.c @@ -1,11 +1,30 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* test_driver * * 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. */ #ifdef HAVE_CONFIG_H diff --git a/testsuites/libtests/devfs04/test_driver.h b/testsuites/libtests/devfs04/test_driver.h index 245ac47a3c..aad3174b76 100644 --- a/testsuites/libtests/devfs04/test_driver.h +++ b/testsuites/libtests/devfs04/test_driver.h @@ -1,11 +1,30 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* test_driver.h * * 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. */ #ifndef __TEST_DRIVER_h diff --git a/testsuites/libtests/deviceio01/deviceio01.doc b/testsuites/libtests/deviceio01/deviceio01.doc index ed7f622ca9..0ca7b4395d 100644 --- a/testsuites/libtests/deviceio01/deviceio01.doc +++ b/testsuites/libtests/deviceio01/deviceio01.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. diff --git a/testsuites/libtests/deviceio01/init.c b/testsuites/libtests/deviceio01/init.c index c27e345be5..009de219f3 100644 --- a/testsuites/libtests/deviceio01/init.c +++ b/testsuites/libtests/deviceio01/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/libtests/deviceio01/test_driver.c b/testsuites/libtests/deviceio01/test_driver.c index 0f80a27ef5..c56b40d63f 100644 --- a/testsuites/libtests/deviceio01/test_driver.c +++ b/testsuites/libtests/deviceio01/test_driver.c @@ -1,10 +1,29 @@ +/* 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. */ #ifdef HAVE_CONFIG_H diff --git a/testsuites/libtests/deviceio01/test_driver.h b/testsuites/libtests/deviceio01/test_driver.h index d6409d2f32..1fd24b1679 100644 --- a/testsuites/libtests/deviceio01/test_driver.h +++ b/testsuites/libtests/deviceio01/test_driver.h @@ -1,10 +1,29 @@ +/* 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. */ #ifndef __TEST_DRIVER_h diff --git a/testsuites/libtests/devnullfatal01/devnullfatal01.doc b/testsuites/libtests/devnullfatal01/devnullfatal01.doc index cc51421cbb..18f52caa45 100644 --- a/testsuites/libtests/devnullfatal01/devnullfatal01.doc +++ b/testsuites/libtests/devnullfatal01/devnullfatal01.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. diff --git a/testsuites/libtests/devnullfatal01/init.c b/testsuites/libtests/devnullfatal01/init.c index ecf63cfe51..2c7b9c0b4d 100644 --- a/testsuites/libtests/devnullfatal01/init.c +++ b/testsuites/libtests/devnullfatal01/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -8,9 +10,26 @@ * COPYRIGHT (c) 1989-2010, 2017. * 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. */ #define FATAL_ERROR_TEST_NAME "/DEV/NULL 1" diff --git a/testsuites/libtests/dl01/dl-load.c b/testsuites/libtests/dl01/dl-load.c index d93550d15b..bd4223acb1 100644 --- a/testsuites/libtests/dl01/dl-load.c +++ b/testsuites/libtests/dl01/dl-load.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include <stdio.h> diff --git a/testsuites/libtests/dl01/dl-load.h b/testsuites/libtests/dl01/dl-load.h index 3f3910a90d..142b195626 100644 --- a/testsuites/libtests/dl01/dl-load.h +++ b/testsuites/libtests/dl01/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(_DL_LOAD_H_) diff --git a/testsuites/libtests/dl01/dl01-o1.c b/testsuites/libtests/dl01/dl01-o1.c index 70fa2d3be8..9350235d85 100644 --- a/testsuites/libtests/dl01/dl01-o1.c +++ b/testsuites/libtests/dl01/dl01-o1.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ /** * Hello World as a loadable module. */ -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl01/dl01.doc b/testsuites/libtests/dl01/dl01.doc index a1099287d4..5e20cdf650 100644 --- a/testsuites/libtests/dl01/dl01.doc +++ b/testsuites/libtests/dl01/dl01.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2014 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl01/init.c b/testsuites/libtests/dl01/init.c index 86cbde94f4..06fa8004b8 100644 --- a/testsuites/libtests/dl01/init.c +++ b/testsuites/libtests/dl01/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -75,7 +94,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT diff --git a/testsuites/libtests/dl02/dl-load.c b/testsuites/libtests/dl02/dl-load.c index b7a5fc54d4..1892d91652 100644 --- a/testsuites/libtests/dl02/dl-load.c +++ b/testsuites/libtests/dl02/dl-load.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include <stdio.h> diff --git a/testsuites/libtests/dl02/dl-load.h b/testsuites/libtests/dl02/dl-load.h index 3f3910a90d..142b195626 100644 --- a/testsuites/libtests/dl02/dl-load.h +++ b/testsuites/libtests/dl02/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(_DL_LOAD_H_) diff --git a/testsuites/libtests/dl02/dl-o2.h b/testsuites/libtests/dl02/dl-o2.h index 43dbd39b9d..e675c24594 100644 --- a/testsuites/libtests/dl02/dl-o2.h +++ b/testsuites/libtests/dl02/dl-o2.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(DL02_H) diff --git a/testsuites/libtests/dl02/dl02-o1.c b/testsuites/libtests/dl02/dl02-o1.c index a7ab2d586c..3b3e51825d 100644 --- a/testsuites/libtests/dl02/dl02-o1.c +++ b/testsuites/libtests/dl02/dl02-o1.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-o2.h" #include <dlfcn.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl02/dl02-o2.c b/testsuites/libtests/dl02/dl02-o2.c index 331fd3bf25..6694c5e985 100644 --- a/testsuites/libtests/dl02/dl02-o2.c +++ b/testsuites/libtests/dl02/dl02-o2.c @@ -1,14 +1,33 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-o2.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__) diff --git a/testsuites/libtests/dl02/dl02.doc b/testsuites/libtests/dl02/dl02.doc index 4a325de9cc..d7e29c75eb 100644 --- a/testsuites/libtests/dl02/dl02.doc +++ b/testsuites/libtests/dl02/dl02.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2014 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl02/init.c b/testsuites/libtests/dl02/init.c index 5245418556..495a58d287 100644 --- a/testsuites/libtests/dl02/init.c +++ b/testsuites/libtests/dl02/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -75,7 +94,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) diff --git a/testsuites/libtests/dl03/dl-bit-alloc.c b/testsuites/libtests/dl03/dl-bit-alloc.c index e4e3cf4c82..211fb71156 100644 --- a/testsuites/libtests/dl03/dl-bit-alloc.c +++ b/testsuites/libtests/dl03/dl-bit-alloc.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016, 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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/libtests/dl03/dl-bit-alloc.h b/testsuites/libtests/dl03/dl-bit-alloc.h index 5795570397..d7696234b5 100644 --- a/testsuites/libtests/dl03/dl-bit-alloc.h +++ b/testsuites/libtests/dl03/dl-bit-alloc.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(_DL_BIT_ALLOC_H_) diff --git a/testsuites/libtests/dl03/dl-cache.c b/testsuites/libtests/dl03/dl-cache.c index f29531b40b..0db6cc1b12 100644 --- a/testsuites/libtests/dl03/dl-cache.c +++ b/testsuites/libtests/dl03/dl-cache.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016, 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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/libtests/dl03/dl-cache.h b/testsuites/libtests/dl03/dl-cache.h index e46df4b939..e77e76879d 100644 --- a/testsuites/libtests/dl03/dl-cache.h +++ b/testsuites/libtests/dl03/dl-cache.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(_DL_CACHE_H_) diff --git a/testsuites/libtests/dl03/dl03.doc b/testsuites/libtests/dl03/dl03.doc index 4a325de9cc..d7e29c75eb 100644 --- a/testsuites/libtests/dl03/dl03.doc +++ b/testsuites/libtests/dl03/dl03.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2014 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl03/init.c b/testsuites/libtests/dl03/init.c index 4fc0b768f9..e953f1a4c6 100644 --- a/testsuites/libtests/dl03/init.c +++ b/testsuites/libtests/dl03/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -61,7 +80,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) diff --git a/testsuites/libtests/dl04/dl-load.c b/testsuites/libtests/dl04/dl-load.c index 9e383a00fb..463d313f28 100644 --- a/testsuites/libtests/dl04/dl-load.c +++ b/testsuites/libtests/dl04/dl-load.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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/libtests/dl04/dl-load.h b/testsuites/libtests/dl04/dl-load.h index c1dca92438..ced07b0841 100644 --- a/testsuites/libtests/dl04/dl-load.h +++ b/testsuites/libtests/dl04/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(_DL_LOAD_H_) diff --git a/testsuites/libtests/dl04/dl04.doc b/testsuites/libtests/dl04/dl04.doc index f36dc7b07f..b728efe22c 100644 --- a/testsuites/libtests/dl04/dl04.doc +++ b/testsuites/libtests/dl04/dl04.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2016 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl04/init.c b/testsuites/libtests/dl04/init.c index 467d28f30a..54a852800d 100644 --- a/testsuites/libtests/dl04/init.c +++ b/testsuites/libtests/dl04/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -75,7 +94,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT diff --git a/testsuites/libtests/dl05/dl-load.c b/testsuites/libtests/dl05/dl-load.c index 11d1404900..a54fe5acf2 100644 --- a/testsuites/libtests/dl05/dl-load.c +++ b/testsuites/libtests/dl05/dl-load.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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/libtests/dl05/dl-load.h b/testsuites/libtests/dl05/dl-load.h index 7a9e1382fd..8f73272427 100644 --- a/testsuites/libtests/dl05/dl-load.h +++ b/testsuites/libtests/dl05/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(_DL_LOAD_H_) diff --git a/testsuites/libtests/dl05/dl05-o5.cc b/testsuites/libtests/dl05/dl05-o5.cc index c861916ff0..f928cf9004 100644 --- a/testsuites/libtests/dl05/dl05-o5.cc +++ b/testsuites/libtests/dl05/dl05-o5.cc @@ -2,7 +2,7 @@ #include <stdexcept> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl05/dl05.doc b/testsuites/libtests/dl05/dl05.doc index 58d4d95fa1..42855852b8 100644 --- a/testsuites/libtests/dl05/dl05.doc +++ b/testsuites/libtests/dl05/dl05.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2016 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl05/init.c b/testsuites/libtests/dl05/init.c index 693ed65172..7e34af757d 100644 --- a/testsuites/libtests/dl05/init.c +++ b/testsuites/libtests/dl05/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -77,7 +96,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (32U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (36U * 1024U) #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT diff --git a/testsuites/libtests/dl06/dl-load.c b/testsuites/libtests/dl06/dl-load.c index 211c05cd3c..3d44c0efa2 100644 --- a/testsuites/libtests/dl06/dl-load.c +++ b/testsuites/libtests/dl06/dl-load.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #define DL06_DEBUG_TRACING 0 diff --git a/testsuites/libtests/dl06/dl-load.h b/testsuites/libtests/dl06/dl-load.h index 3f3910a90d..142b195626 100644 --- a/testsuites/libtests/dl06/dl-load.h +++ b/testsuites/libtests/dl06/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(_DL_LOAD_H_) diff --git a/testsuites/libtests/dl06/dl06-o1.c b/testsuites/libtests/dl06/dl06-o1.c index 57124ccff5..1b8482bc3e 100644 --- a/testsuites/libtests/dl06/dl06-o1.c +++ b/testsuites/libtests/dl06/dl06-o1.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl06-o2.h" @@ -11,7 +30,7 @@ #include <dlfcn.h> #include <math.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl06/dl06-o2.c b/testsuites/libtests/dl06/dl06-o2.c index 3c374b2371..0a46c027a8 100644 --- a/testsuites/libtests/dl06/dl06-o2.c +++ b/testsuites/libtests/dl06/dl06-o2.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl06-o2.h" @@ -11,7 +30,7 @@ #include <stdlib.h> #include <math.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl06/dl06-o2.h b/testsuites/libtests/dl06/dl06-o2.h index 12be7ee197..f613a621e1 100644 --- a/testsuites/libtests/dl06/dl06-o2.h +++ b/testsuites/libtests/dl06/dl06-o2.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #if !defined(DL06_02_H) diff --git a/testsuites/libtests/dl06/dl06.doc b/testsuites/libtests/dl06/dl06.doc index 8487385b04..bd50220c8b 100644 --- a/testsuites/libtests/dl06/dl06.doc +++ b/testsuites/libtests/dl06/dl06.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2018 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl06/init.c b/testsuites/libtests/dl06/init.c index 413ebf0d11..65d143760f 100644 --- a/testsuites/libtests/dl06/init.c +++ b/testsuites/libtests/dl06/init.c @@ -1 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup libtests + * + * @brief This is init for dl06. + */ + +/* + * Copyright (C) 2018 Chris Johns <chrisj@rtems.org>. + * + * 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. + */ + #include "initimpl.h" diff --git a/testsuites/libtests/dl06/initimpl.h b/testsuites/libtests/dl06/initimpl.h index 2611124287..0d3987983d 100644 --- a/testsuites/libtests/dl06/initimpl.h +++ b/testsuites/libtests/dl06/initimpl.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -79,7 +98,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) diff --git a/testsuites/libtests/dl06/pre-init.c b/testsuites/libtests/dl06/pre-init.c index 6dc232a574..0eeef9f814 100644 --- a/testsuites/libtests/dl06/pre-init.c +++ b/testsuites/libtests/dl06/pre-init.c @@ -1,2 +1,37 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup libtests + * + * @brief This is pre-init for dl06. + */ + +/* + * Copyright (C) 2018 Chris Johns <chrisj@rtems.org>. + * + * 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. + */ + #define DL06_PRE 1 #include "initimpl.h" diff --git a/testsuites/libtests/dl07/dl-load.c b/testsuites/libtests/dl07/dl-load.c index b92a745f42..2946120ca6 100644 --- a/testsuites/libtests/dl07/dl-load.c +++ b/testsuites/libtests/dl07/dl-load.c @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #define TEST_TRACE 0 @@ -13,6 +32,7 @@ RTEMS_RTL_TRACE_WARNING | \ RTEMS_RTL_TRACE_LOAD | \ RTEMS_RTL_TRACE_UNLOAD | \ + RTEMS_RTL_TRACE_LOAD_SECT | \ RTEMS_RTL_TRACE_SYMBOL | \ RTEMS_RTL_TRACE_RELOC | \ RTEMS_RTL_TRACE_ALLOCATOR | \ diff --git a/testsuites/libtests/dl07/dl-load.h b/testsuites/libtests/dl07/dl-load.h index 72872917aa..ae1536502a 100644 --- a/testsuites/libtests/dl07/dl-load.h +++ b/testsuites/libtests/dl07/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014, 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include <string.h> diff --git a/testsuites/libtests/dl07/dl-o1.h b/testsuites/libtests/dl07/dl-o1.h index bf07eb6a45..745e548778 100644 --- a/testsuites/libtests/dl07/dl-o1.h +++ b/testsuites/libtests/dl07/dl-o1.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL01_H) diff --git a/testsuites/libtests/dl07/dl-o2.h b/testsuites/libtests/dl07/dl-o2.h index 0d97c5cff9..d7812c4475 100644 --- a/testsuites/libtests/dl07/dl-o2.h +++ b/testsuites/libtests/dl07/dl-o2.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL02_H) diff --git a/testsuites/libtests/dl07/dl-o4.h b/testsuites/libtests/dl07/dl-o4.h index 371279be9e..7ea5139fe9 100644 --- a/testsuites/libtests/dl07/dl-o4.h +++ b/testsuites/libtests/dl07/dl-o4.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL04_H) diff --git a/testsuites/libtests/dl07/dl-o5.h b/testsuites/libtests/dl07/dl-o5.h index 04974a03d4..606a39c2b3 100644 --- a/testsuites/libtests/dl07/dl-o5.h +++ b/testsuites/libtests/dl07/dl-o5.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include <stdint.h> diff --git a/testsuites/libtests/dl07/dl07-o1.c b/testsuites/libtests/dl07/dl07-o1.c index adb452b96e..0bca0ab838 100644 --- a/testsuites/libtests/dl07/dl07-o1.c +++ b/testsuites/libtests/dl07/dl07-o1.c @@ -1,15 +1,34 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include "dl-o1.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #include "dl-load.h" #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl07/dl07-o2.c b/testsuites/libtests/dl07/dl07-o2.c index d31d0e5f4e..46aef0d6fe 100644 --- a/testsuites/libtests/dl07/dl07-o2.c +++ b/testsuites/libtests/dl07/dl07-o2.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o1.h" #include "dl-o2.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl07/dl07-o3.c b/testsuites/libtests/dl07/dl07-o3.c index ecdd72f8a9..ab60f50e97 100644 --- a/testsuites/libtests/dl07/dl07-o3.c +++ b/testsuites/libtests/dl07/dl07-o3.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" @@ -13,7 +32,7 @@ #include "dl-o5.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl07/dl07-o4.c b/testsuites/libtests/dl07/dl07-o4.c index ad9fe9da32..e5f831ec24 100644 --- a/testsuites/libtests/dl07/dl07-o4.c +++ b/testsuites/libtests/dl07/dl07-o4.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o1.h" #include "dl-o4.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl07/dl07-o5.c b/testsuites/libtests/dl07/dl07-o5.c index cb04a3e5be..83e98f6d9d 100644 --- a/testsuites/libtests/dl07/dl07-o5.c +++ b/testsuites/libtests/dl07/dl07-o5.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" @@ -11,7 +30,7 @@ #include "dl-o5.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl07/dl07.doc b/testsuites/libtests/dl07/dl07.doc index 9a06de16fc..9535ded722 100644 --- a/testsuites/libtests/dl07/dl07.doc +++ b/testsuites/libtests/dl07/dl07.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2018 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl07/init.c b/testsuites/libtests/dl07/init.c index 40cca25202..8db106ba29 100644 --- a/testsuites/libtests/dl07/init.c +++ b/testsuites/libtests/dl07/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -81,7 +100,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) diff --git a/testsuites/libtests/dl08/dl-load.c b/testsuites/libtests/dl08/dl-load.c index 44330e8f9d..680283b5c3 100644 --- a/testsuites/libtests/dl08/dl-load.c +++ b/testsuites/libtests/dl08/dl-load.c @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #define TEST_TRACE 0 diff --git a/testsuites/libtests/dl08/dl-load.h b/testsuites/libtests/dl08/dl-load.h index 72872917aa..ae1536502a 100644 --- a/testsuites/libtests/dl08/dl-load.h +++ b/testsuites/libtests/dl08/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014, 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include <string.h> diff --git a/testsuites/libtests/dl08/dl-o1.h b/testsuites/libtests/dl08/dl-o1.h index f6a10f1481..598ef785ad 100644 --- a/testsuites/libtests/dl08/dl-o1.h +++ b/testsuites/libtests/dl08/dl-o1.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL01_H) diff --git a/testsuites/libtests/dl08/dl-o2.h b/testsuites/libtests/dl08/dl-o2.h index d6c1820f46..f0805945cc 100644 --- a/testsuites/libtests/dl08/dl-o2.h +++ b/testsuites/libtests/dl08/dl-o2.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL02_H) diff --git a/testsuites/libtests/dl08/dl-o3.h b/testsuites/libtests/dl08/dl-o3.h index 8c5d18dfb1..54a3f84c97 100644 --- a/testsuites/libtests/dl08/dl-o3.h +++ b/testsuites/libtests/dl08/dl-o3.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL03_H) diff --git a/testsuites/libtests/dl08/dl-o4.h b/testsuites/libtests/dl08/dl-o4.h index bab9fc1ae4..a4b129f338 100644 --- a/testsuites/libtests/dl08/dl-o4.h +++ b/testsuites/libtests/dl08/dl-o4.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL04_H) diff --git a/testsuites/libtests/dl08/dl-o5.h b/testsuites/libtests/dl08/dl-o5.h index bb4ce468a2..50b5f6234e 100644 --- a/testsuites/libtests/dl08/dl-o5.h +++ b/testsuites/libtests/dl08/dl-o5.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include <stdint.h> diff --git a/testsuites/libtests/dl08/dl-o6.h b/testsuites/libtests/dl08/dl-o6.h index 0dde92857b..4f10fd917c 100644 --- a/testsuites/libtests/dl08/dl-o6.h +++ b/testsuites/libtests/dl08/dl-o6.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include <stdint.h> diff --git a/testsuites/libtests/dl08/dl08-o1.c b/testsuites/libtests/dl08/dl08-o1.c index 422d25bb09..015e847ea2 100644 --- a/testsuites/libtests/dl08/dl08-o1.c +++ b/testsuites/libtests/dl08/dl08-o1.c @@ -1,15 +1,34 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include "dl-o1.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #include "dl-load.h" #include "dl-o1.h" #include "dl-o2.h" diff --git a/testsuites/libtests/dl08/dl08-o2.c b/testsuites/libtests/dl08/dl08-o2.c index f4a459f451..3833cb5768 100644 --- a/testsuites/libtests/dl08/dl08-o2.c +++ b/testsuites/libtests/dl08/dl08-o2.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o2.h" #include "dl-o3.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl08/dl08-o3.c b/testsuites/libtests/dl08/dl08-o3.c index af5976c6de..dc839bf270 100644 --- a/testsuites/libtests/dl08/dl08-o3.c +++ b/testsuites/libtests/dl08/dl08-o3.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" @@ -12,7 +31,7 @@ #include "dl-o5.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl08/dl08-o4.c b/testsuites/libtests/dl08/dl08-o4.c index 7cbd4aadd6..d09fd2ec93 100644 --- a/testsuites/libtests/dl08/dl08-o4.c +++ b/testsuites/libtests/dl08/dl08-o4.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o4.h" #include "dl-o5.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl08/dl08-o5.c b/testsuites/libtests/dl08/dl08-o5.c index c4fa9ecdf1..de86437757 100644 --- a/testsuites/libtests/dl08/dl08-o5.c +++ b/testsuites/libtests/dl08/dl08-o5.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" @@ -11,7 +30,7 @@ #include "dl-o6.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c b/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c index b8c4b2aac6..47d3f66f76 100644 --- a/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c +++ b/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o6.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl08/dl08.doc b/testsuites/libtests/dl08/dl08.doc index 29819bbc83..85f69f2582 100644 --- a/testsuites/libtests/dl08/dl08.doc +++ b/testsuites/libtests/dl08/dl08.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2018 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl08/init.c b/testsuites/libtests/dl08/init.c index a675464146..23ebe41d63 100644 --- a/testsuites/libtests/dl08/init.c +++ b/testsuites/libtests/dl08/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -81,7 +100,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) diff --git a/testsuites/libtests/dl09/dl-load.c b/testsuites/libtests/dl09/dl-load.c index 9b03a3746c..216fb5a201 100644 --- a/testsuites/libtests/dl09/dl-load.c +++ b/testsuites/libtests/dl09/dl-load.c @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2019 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #define TEST_TRACE 0 @@ -97,8 +116,12 @@ static void dl_check_resolved(void* handle, bool has_unresolved) rtems_test_assert (unresolved == 0); } } - printf ("handel: %p: %sunresolved externals\n", - handle, unresolved != 0 ? "" : "no "); + if (handle == RTLD_SELF) + printf ("handle: RTL_SELF: %sunresolved externals\n", + unresolved != 0 ? "" : "no "); + else + printf ("handle: %p: %sunresolved externals\n", + handle, unresolved != 0 ? "" : "no "); } static void* dl_load_obj (const char* name, bool has_unresolved) @@ -133,12 +156,20 @@ static void dl_close (void* handle) static int dl_call (void* handle, const char* func) { + static call_sig last_call; call_sig call = dlsym (handle, func); if (call == NULL) { printf("dlsym failed: symbol not found: %s\n", func); return 1; } + if (last_call != NULL && last_call != call) + { + printf("Call location different: moved by: %i (call:%p last:%p)\n", + (int) (call - last_call), + call, last_call); + } + last_call = call; call (); return 0; } @@ -152,7 +183,7 @@ static void dl_object_open (object_def* od, objects* o) if (od->space != 0) { o->space = malloc (od->space); - printf("space alloc: %s: %d: %p\n", od->name, od->space, o->space); + printf("space alloc: %s: %zd: %p\n", od->name, od->space, o->space); rtems_test_assert (o->space != NULL); } dl_load_dump (); diff --git a/testsuites/libtests/dl09/dl-load.h b/testsuites/libtests/dl09/dl-load.h index 72872917aa..ae1536502a 100644 --- a/testsuites/libtests/dl09/dl-load.h +++ b/testsuites/libtests/dl09/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014, 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include <string.h> diff --git a/testsuites/libtests/dl09/dl-o1.h b/testsuites/libtests/dl09/dl-o1.h index f6a10f1481..598ef785ad 100644 --- a/testsuites/libtests/dl09/dl-o1.h +++ b/testsuites/libtests/dl09/dl-o1.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL01_H) diff --git a/testsuites/libtests/dl09/dl-o2.h b/testsuites/libtests/dl09/dl-o2.h index d6c1820f46..f0805945cc 100644 --- a/testsuites/libtests/dl09/dl-o2.h +++ b/testsuites/libtests/dl09/dl-o2.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL02_H) diff --git a/testsuites/libtests/dl09/dl-o3.h b/testsuites/libtests/dl09/dl-o3.h index 8c5d18dfb1..54a3f84c97 100644 --- a/testsuites/libtests/dl09/dl-o3.h +++ b/testsuites/libtests/dl09/dl-o3.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL03_H) diff --git a/testsuites/libtests/dl09/dl-o4.h b/testsuites/libtests/dl09/dl-o4.h index bab9fc1ae4..a4b129f338 100644 --- a/testsuites/libtests/dl09/dl-o4.h +++ b/testsuites/libtests/dl09/dl-o4.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL04_H) diff --git a/testsuites/libtests/dl09/dl-o5.h b/testsuites/libtests/dl09/dl-o5.h index bb4ce468a2..50b5f6234e 100644 --- a/testsuites/libtests/dl09/dl-o5.h +++ b/testsuites/libtests/dl09/dl-o5.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include <stdint.h> diff --git a/testsuites/libtests/dl09/dl09-o1.c b/testsuites/libtests/dl09/dl09-o1.c index 45cc6edcfa..291d33fcd0 100644 --- a/testsuites/libtests/dl09/dl09-o1.c +++ b/testsuites/libtests/dl09/dl09-o1.c @@ -1,15 +1,34 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include "dl-o1.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #include "dl-load.h" #include "dl-o1.h" #include "dl-o2.h" diff --git a/testsuites/libtests/dl09/dl09-o2.c b/testsuites/libtests/dl09/dl09-o2.c index 48a0786b9c..e8976f3b49 100644 --- a/testsuites/libtests/dl09/dl09-o2.c +++ b/testsuites/libtests/dl09/dl09-o2.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o2.h" #include "dl-o3.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl09/dl09-o3.c b/testsuites/libtests/dl09/dl09-o3.c index 9fb0591d37..d9a056d45d 100644 --- a/testsuites/libtests/dl09/dl09-o3.c +++ b/testsuites/libtests/dl09/dl09-o3.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" @@ -12,7 +31,7 @@ #include "dl-o5.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl09/dl09-o4.c b/testsuites/libtests/dl09/dl09-o4.c index 2ae0ef5ea8..8998059c93 100644 --- a/testsuites/libtests/dl09/dl09-o4.c +++ b/testsuites/libtests/dl09/dl09-o4.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o4.h" #include "dl-o5.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl09/dl09-o5.c b/testsuites/libtests/dl09/dl09-o5.c index badeaed53f..e5374f3eb8 100644 --- a/testsuites/libtests/dl09/dl09-o5.c +++ b/testsuites/libtests/dl09/dl09-o5.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2019 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" @@ -11,7 +30,7 @@ #include "dl-o5.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl09/dl09.doc b/testsuites/libtests/dl09/dl09.doc index f9df9a276d..c820424d14 100644 --- a/testsuites/libtests/dl09/dl09.doc +++ b/testsuites/libtests/dl09/dl09.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2019 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl09/init.c b/testsuites/libtests/dl09/init.c index a95a57ad45..b375fe3f38 100644 --- a/testsuites/libtests/dl09/init.c +++ b/testsuites/libtests/dl09/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -81,7 +100,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) diff --git a/testsuites/libtests/dl10/dl-load.c b/testsuites/libtests/dl10/dl-load.c index dee1d6e9cc..62cf2ec15e 100644 --- a/testsuites/libtests/dl10/dl-load.c +++ b/testsuites/libtests/dl10/dl-load.c @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #define TEST_TRACE 0 @@ -96,28 +115,6 @@ static void* dl_load_obj(const char* name, bool has_unresolved) return handle; } -static void dl_close (void* handle) -{ - int r; - printf ("handle: %p closing\n", handle); - r = dlclose (handle); - if (r != 0) - printf("dlclose failed: %s\n", dlerror()); - rtems_test_assert (r == 0); -} - -static int dl_call (void* handle, const char* func) -{ - call_sig call = dlsym (handle, func); - if (call == NULL) - { - printf("dlsym failed: symbol not found: %s\n", func); - return 1; - } - call (); - return 0; -} - int dl_load_test(void) { void* o1; diff --git a/testsuites/libtests/dl10/dl-load.h b/testsuites/libtests/dl10/dl-load.h index 72872917aa..ae1536502a 100644 --- a/testsuites/libtests/dl10/dl-load.h +++ b/testsuites/libtests/dl10/dl-load.h @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014, 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include <string.h> diff --git a/testsuites/libtests/dl10/dl-o1.h b/testsuites/libtests/dl10/dl-o1.h index f6a10f1481..598ef785ad 100644 --- a/testsuites/libtests/dl10/dl-o1.h +++ b/testsuites/libtests/dl10/dl-o1.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL01_H) diff --git a/testsuites/libtests/dl10/dl-o2.h b/testsuites/libtests/dl10/dl-o2.h index d6c1820f46..f0805945cc 100644 --- a/testsuites/libtests/dl10/dl-o2.h +++ b/testsuites/libtests/dl10/dl-o2.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL02_H) diff --git a/testsuites/libtests/dl10/dl-o3.h b/testsuites/libtests/dl10/dl-o3.h index 8c5d18dfb1..54a3f84c97 100644 --- a/testsuites/libtests/dl10/dl-o3.h +++ b/testsuites/libtests/dl10/dl-o3.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL03_H) diff --git a/testsuites/libtests/dl10/dl-o4.h b/testsuites/libtests/dl10/dl-o4.h index bab9fc1ae4..a4b129f338 100644 --- a/testsuites/libtests/dl10/dl-o4.h +++ b/testsuites/libtests/dl10/dl-o4.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #if !defined(DL04_H) diff --git a/testsuites/libtests/dl10/dl-o5.h b/testsuites/libtests/dl10/dl-o5.h index bb4ce468a2..50b5f6234e 100644 --- a/testsuites/libtests/dl10/dl-o5.h +++ b/testsuites/libtests/dl10/dl-o5.h @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include <stdint.h> diff --git a/testsuites/libtests/dl10/dl10-o1.c b/testsuites/libtests/dl10/dl10-o1.c index 422d25bb09..015e847ea2 100644 --- a/testsuites/libtests/dl10/dl10-o1.c +++ b/testsuites/libtests/dl10/dl10-o1.c @@ -1,15 +1,34 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. * All rights reserved. * - * 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. */ #include "dl-o1.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #include "dl-load.h" #include "dl-o1.h" #include "dl-o2.h" diff --git a/testsuites/libtests/dl10/dl10-o2.c b/testsuites/libtests/dl10/dl10-o2.c index f4a459f451..3833cb5768 100644 --- a/testsuites/libtests/dl10/dl10-o2.c +++ b/testsuites/libtests/dl10/dl10-o2.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o2.h" #include "dl-o3.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl10/dl10-o3.c b/testsuites/libtests/dl10/dl10-o3.c index af5976c6de..dc839bf270 100644 --- a/testsuites/libtests/dl10/dl10-o3.c +++ b/testsuites/libtests/dl10/dl10-o3.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" @@ -12,7 +31,7 @@ #include "dl-o5.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl10/dl10-o4.c b/testsuites/libtests/dl10/dl10-o4.c index 7cbd4aadd6..d09fd2ec93 100644 --- a/testsuites/libtests/dl10/dl10-o4.c +++ b/testsuites/libtests/dl10/dl10-o4.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o4.h" #include "dl-o5.h" -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl10/dl10-o5.c b/testsuites/libtests/dl10/dl10-o5.c index 832c029ec8..185c259d8c 100644 --- a/testsuites/libtests/dl10/dl10-o5.c +++ b/testsuites/libtests/dl10/dl10-o5.c @@ -1,16 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" #include "dl-o5.h" #include <inttypes.h> -#include <rtems/test-info.h> +#include <rtems/test-printer.h> #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); diff --git a/testsuites/libtests/dl10/dl10-o6.c b/testsuites/libtests/dl10/dl10-o6.c index ab6deb189d..2484ff6f2f 100644 --- a/testsuites/libtests/dl10/dl10-o6.c +++ b/testsuites/libtests/dl10/dl10-o6.c @@ -1,15 +1,34 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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. */ #include "dl-load.h" +#include "dl-o5.h" #include <inttypes.h> -#include <rtems/test-info.h> int rtems_main_o5 (void) { diff --git a/testsuites/libtests/dl10/dl10.doc b/testsuites/libtests/dl10/dl10.doc index 82469da593..bee13b1c2a 100644 --- a/testsuites/libtests/dl10/dl10.doc +++ b/testsuites/libtests/dl10/dl10.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2019 Chris Johns <chrisj@rtems.org> # -# 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. diff --git a/testsuites/libtests/dl10/init.c b/testsuites/libtests/dl10/init.c index b488a321ab..04f71eaaba 100644 --- a/testsuites/libtests/dl10/init.c +++ b/testsuites/libtests/dl10/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. * - * 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 @@ -27,9 +46,6 @@ const char rtems_test_name[] = "libdl (RTL) 10"; -/* forward declarations to avoid warnings */ -static rtems_task Init(rtems_task_argument argument); - #include "dl10-tar.h" #define TARFILE_START dl10_tar @@ -46,9 +62,18 @@ static int test(void) return 0; } +static void notification(int fd, int seconds_remaining, void *arg) +{ + printf( + "Press any key to enter shell (%is remaining)\n", + seconds_remaining + ); +} + static void Init(rtems_task_argument arg) { int e; + rtems_status_code sc; TEST_BEGIN(); @@ -76,13 +101,20 @@ static void Init(rtems_task_argument arg) exit (1); } - rtems_shell_init ("SHLL", - RTEMS_MINIMUM_STACK_SIZE * 4, - 100, - "/dev/foobar", - false, - true, - NULL); + + sc = rtems_shell_wait_for_input (STDIN_FILENO, + 20, + notification, + NULL); + if (sc == RTEMS_SUCCESSFUL) { + rtems_shell_init ("SHLL", + RTEMS_MINIMUM_STACK_SIZE * 4, + 100, + "/dev/foobar", + false, + true, + NULL); + } TEST_END(); @@ -116,7 +148,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (8U * 1024U) +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) diff --git a/testsuites/libtests/dl11/dl-load.c b/testsuites/libtests/dl11/dl-load.c new file mode 100644 index 0000000000..b09128acdf --- /dev/null +++ b/testsuites/libtests/dl11/dl-load.c @@ -0,0 +1,207 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2023 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. + */ + +#include <errno.h> +#include <stdio.h> +#include "tmacros.h" +#include <pthread.h> + +#include <dlfcn.h> + +#include "dl-load.h" + +#include <rtems/rtl/rtl-shell.h> +#include <rtems/rtl/rtl-trace.h> + +#define TEST_TRACE 0 +#if TEST_TRACE + #define SHOW_GLOBAL_SYMS 1 + #if SHOW_GLOBAL_SYMS + #define TRACE_GLOBAL_SYMBOL RTEMS_RTL_TRACE_GLOBAL_SYM + #else + #define TRACE_GLOBAL_SYMBOL 0 + #endif + #define DEBUG_TRACE (RTEMS_RTL_TRACE_DETAIL | \ + RTEMS_RTL_TRACE_WARNING | \ + RTEMS_RTL_TRACE_LOAD | \ + RTEMS_RTL_TRACE_UNLOAD | \ + TRACE_GLOBAL_SYMBOL | \ + RTEMS_RTL_TRACE_SYMBOL | \ + RTEMS_RTL_TRACE_RELOC | \ + RTEMS_RTL_TRACE_ALLOCATOR | \ + RTEMS_RTL_TRACE_UNRESOLVED | \ + RTEMS_RTL_TRACE_ARCHIVES | \ + RTEMS_RTL_TRACE_DEPENDENCY) + #define DL_DEBUG_TRACE DEBUG_TRACE /* RTEMS_RTL_TRACE_ALL */ + #define DL_RTL_CMDS 1 +#else + #define DL_DEBUG_TRACE 0 + #define DL_RTL_CMDS 0 +#endif + +static void dl_load_dump (void) +{ +#if DL_RTL_CMDS + char* list[] = { "rtl", "list", NULL }; + char* sym[] = { "rtl", "sym", NULL }; + printf ("RTL List:\n"); + rtems_rtl_shell_command (2, list); + printf ("RTL Sym:\n"); + rtems_rtl_shell_command (2, sym); +#endif +} + +typedef int (*int_call_t)(void); +typedef int* (*ptr_call_t)(void); + +void* get_errno_ptr(void); +int get_errno(void); + +int_call_t int_call; +ptr_call_t ptr_call; +static int perform_test(void) +{ + int int_call_ret; + int* ptr_call_ret; + ptr_call_ret = ptr_call (); + if (ptr_call_ret != get_errno_ptr()) + { + printf("dlsym ptr_call failed: ret value bad\n"); + return 1; + } + + errno = 12345; + int_call_ret = int_call (); + if (int_call_ret != get_errno()) + { + printf("dlsym int_call failed: ret value bad\n"); + return 1; + } + errno = 0; + + return 0; +} + +static void *secondary_thread(void *arg) +{ + printf("Running test on secondary thread\n"); + if (perform_test()) { + printf("Test failed on secondary task\n"); + return (void *) 1; + } + + return NULL; +} + +static void start_secondary(void) +{ + /* Run the test on a secondary thread */ + pthread_t threadId; + int status; + void *ret; + status = pthread_create( &threadId, NULL, secondary_thread, NULL ); + rtems_test_assert( !status ); + + /* Wait on thread to exit */ + status = pthread_join(threadId, &ret); + rtems_test_assert( !status ); + rtems_test_assert( ret == NULL ); +} + +int dl_load_test(void) +{ + void* handle; + int unresolved; + char* message = "loaded"; + +#if DL_DEBUG_TRACE + rtems_rtl_trace_set_mask (DL_DEBUG_TRACE); +#endif + + printf("load: /dl11-o1.o\n"); + + handle = dlopen ("/dl11-o1.o", RTLD_NOW | RTLD_GLOBAL); + if (!handle) + { + printf("dlopen failed: %s\n", dlerror()); + return 1; + } + + if (dlinfo (handle, RTLD_DI_UNRESOLVED, &unresolved) < 0) + message = "dlinfo error checking unresolved status"; + else if (unresolved) + message = "has unresolved externals"; + + printf ("handle: %p %s\n", handle, message); + + dl_load_dump (); + + ptr_call = dlsym (handle, "get_errno_ptr"); + if (ptr_call == NULL) + { + printf("dlsym failed: symbol get_errno_ptr not found\n"); + return 1; + } + + int_call = dlsym (handle, "get_errno_val"); + if (int_call == NULL) + { + printf("dlsym failed: symbol get_errno_val not found\n"); + return 1; + } + + /* Run the test on the init thread */ + printf("Running test on init task\n"); + if (perform_test()) { + return 1; + } + + start_secondary(); + + if (dlclose (handle) < 0) + { + printf("dlclose failed: %s\n", dlerror()); + return 1; + } + + printf ("handle: %p closed\n", handle); + + return 0; +} + +/* + * Disasseble these to see how the platform accesses TLS + */ +void* get_errno_ptr(void) +{ + return &errno; +} + +int get_errno(void) +{ + return errno; +} diff --git a/testsuites/libtests/dl11/dl-load.h b/testsuites/libtests/dl11/dl-load.h new file mode 100644 index 0000000000..142b195626 --- /dev/null +++ b/testsuites/libtests/dl11/dl-load.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. + * + * 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. + */ + +#if !defined(_DL_LOAD_H_) +#define _DL_LOAD_H_ + +int dl_load_test(void); + +#endif diff --git a/testsuites/libtests/dl11/dl11-o1.c b/testsuites/libtests/dl11/dl11-o1.c new file mode 100644 index 0000000000..93ee2a60c7 --- /dev/null +++ b/testsuites/libtests/dl11/dl11-o1.c @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2023 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. + */ + +#include <errno.h> + +int get_errno_val (void); +int *get_errno_ptr (void); + +int get_errno_val (void) +{ + return errno; +} + +int *get_errno_ptr (void) +{ + return &errno; +} diff --git a/testsuites/libtests/dl11/dl11.doc b/testsuites/libtests/dl11/dl11.doc new file mode 100644 index 0000000000..0fffe1cfd3 --- /dev/null +++ b/testsuites/libtests/dl11/dl11.doc @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: BSD-2-Clause + +# Copyright (C) 2023 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: dl11 + +directives: + + dlopen + dlinfo + dlsym + dlclose + +concepts: + ++ Load a single ELF object file. ++ Check there are no unreolved externals. ++ Locate the get_errno_val and get_errno_ptr symbols. ++ Call the functions that use TLS variables and verify relocated symbols. ++ Unload the ELF file. diff --git a/testsuites/libtests/dl11/dl11.scn b/testsuites/libtests/dl11/dl11.scn new file mode 100644 index 0000000000..43048c91d2 --- /dev/null +++ b/testsuites/libtests/dl11/dl11.scn @@ -0,0 +1,6 @@ +*** BEGIN OF TEST libdl (RTL) 11 *** +load: /dl11-o1.o +handle: 0x40118e60 loaded +handle: 0x40118e60 closed + +*** END OF TEST libdl (RTL) 11 *** diff --git a/testsuites/libtests/dl11/init.c b/testsuites/libtests/dl11/init.c new file mode 100644 index 0000000000..0ff4557421 --- /dev/null +++ b/testsuites/libtests/dl11/init.c @@ -0,0 +1,105 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (c) 2014 Chris Johns <chrisj@rtems.org>. All rights reserved. + * + * 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 "tmacros.h" + +#include <errno.h> +#include <string.h> +#include <stdint.h> +#include <unistd.h> + +#include <rtems/rtl/rtl.h> +#include <rtems/imfs.h> + +#include "dl-load.h" + +const char rtems_test_name[] = "libdl (RTL) 11"; + +/* forward declarations to avoid warnings */ +static rtems_task Init(rtems_task_argument argument); + +#include "dl11-tar.h" + +#define TARFILE_START dl11_tar +#define TARFILE_SIZE dl11_tar_size + +static int test(void) +{ + int ret; + ret = dl_load_test(); + if (ret) + rtems_test_exit(ret); + return 0; +} + +static void Init(rtems_task_argument arg) +{ + int te; + + TEST_BEGIN(); + + te = rtems_tarfs_load("/", (void *)TARFILE_START, (size_t)TARFILE_SIZE); + if (te != 0) + { + printf("untar failed: %d\n", te); + rtems_test_exit(1); + exit (1); + } + + test(); + + TEST_END(); + + rtems_test_exit(0); +} + +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER + +#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 4 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 + +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT_TASK_STACK_SIZE (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (4U * 1024U)) + +#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT + +#define CONFIGURE_INIT + +#include <rtems/confdefs.h> diff --git a/testsuites/libtests/dumpbuf01/dumpbuf01.doc b/testsuites/libtests/dumpbuf01/dumpbuf01.doc index 5249321e8e..1269733c47 100644 --- a/testsuites/libtests/dumpbuf01/dumpbuf01.doc +++ b/testsuites/libtests/dumpbuf01/dumpbuf01.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. diff --git a/testsuites/libtests/dumpbuf01/init.c b/testsuites/libtests/dumpbuf01/init.c index 45cf0c2f5a..e103990176 100644 --- a/testsuites/libtests/dumpbuf01/init.c +++ b/testsuites/libtests/dumpbuf01/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/libtests/exit01/init.c b/testsuites/libtests/exit01/init.c index 9e2c61b493..0938cff025 100644 --- a/testsuites/libtests/exit01/init.c +++ b/testsuites/libtests/exit01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2013 embedded brains GmbH. All rights reserved. + * Copyright (c) 2013 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/exit02/init.c b/testsuites/libtests/exit02/init.c index f9be68b3b5..8d8e43c173 100644 --- a/testsuites/libtests/exit02/init.c +++ b/testsuites/libtests/exit02/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2013 embedded brains GmbH. All rights reserved. + * Copyright (c) 2013 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/mghttpd01/mghttpd01.doc b/testsuites/libtests/exit03/exit03.doc index 7db498b7ca..c575ef40fb 100644 --- a/testsuites/libtests/mghttpd01/mghttpd01.doc +++ b/testsuites/libtests/exit03/exit03.doc @@ -1,11 +1,11 @@ This file describes the directives and concepts tested by this test set. -test set name: mghttpd01 +test set name: exit03 directives: - TBD + exit() concepts: - - Ensure that the Mongoose HTTP server works with a basic setup + Ensure exit() in a C++ application works. diff --git a/testsuites/libtests/exit03/exit03.scn b/testsuites/libtests/exit03/exit03.scn new file mode 100644 index 0000000000..03d45a0c1f --- /dev/null +++ b/testsuites/libtests/exit03/exit03.scn @@ -0,0 +1,5 @@ +caught exception +IO on std::cout +IO on std::cerr + +*** END OF TEST EXIT 3 *** diff --git a/testsuites/libtests/exit03/init.c b/testsuites/libtests/exit03/init.c new file mode 100644 index 0000000000..44acb35c6e --- /dev/null +++ b/testsuites/libtests/exit03/init.c @@ -0,0 +1,122 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (c) 2022 Chris Johns (Contemporary Software). All rights reserved. + * Copyright (c) 2013 embedded brains GmbH & Co. KG + * + * 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 "tmacros.h" + +#include <stdlib.h> + +/* Use assert() not rtems_test_assert() since it uses exit() */ +#include <assert.h> + +#include <rtems.h> + +void cplusplus_stdio(void); + +const char rtems_test_name[] = "EXIT 3"; + +#define EXIT_STATUS 123 + +static int counter; + +static void atexit_0(void) +{ + assert(counter == 0); + ++counter; +} + +static void fatal_extension( + rtems_fatal_source source, + bool always_set_to_false, + rtems_fatal_code error +) +{ + if ( + source == RTEMS_FATAL_SOURCE_EXIT + && !always_set_to_false + && error == EXIT_STATUS + && counter == 1 + ) { + TEST_END(); + } +} + +static void exit_task(rtems_task_argument arg) +{ + int rv; + + rv = atexit(atexit_0); + assert(rv == 0); + + cplusplus_stdio(); + + exit(EXIT_STATUS); +} + +static void Init(rtems_task_argument arg) +{ + rtems_status_code sc; + rtems_id id; + + TEST_BEGIN(); + + sc = rtems_task_create( + rtems_build_name('E', 'X', 'I', 'T'), + RTEMS_MINIMUM_PRIORITY, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &id + ); + assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_task_start(id, exit_task, 0); + assert(sc == RTEMS_SUCCESSFUL); + + rtems_task_exit(); +} + +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER + +#define CONFIGURE_INITIAL_EXTENSIONS \ + { .fatal = fatal_extension }, \ + RTEMS_TEST_INITIAL_EXTENSION + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_KEYS 2 + +#define CONFIGURE_INIT + +#include <rtems/confdefs.h> diff --git a/testsuites/libtests/exit03/stdio.cc b/testsuites/libtests/exit03/stdio.cc new file mode 100644 index 0000000000..09f2f1951c --- /dev/null +++ b/testsuites/libtests/exit03/stdio.cc @@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (c) 2022 Chris Johns (Contemporary Software). All rights reserved. + * Copyright (c) 2013 embedded brains GmbH & Co. KG + * + * 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 <exception> +#include <iostream> + +extern "C" { +void cplusplus_stdio(void); +} + +static void throw_something() { + throw std::runtime_error("something"); +} + +static void throw_and_catch() { + try { + throw_something(); + std::cout << "nothing caught exception" << std::endl; + } catch (std::runtime_error& e) { + std::cout << "caught exception" << std::endl; + } +} + +void cplusplus_stdio(void) { + std::set_terminate([](){ + std::cout << "FATAL: terminate called" << std::endl; + std::abort(); + }); + throw_and_catch(); + std::cout << "IO on std::cout" << std::endl; + std::cerr << "IO on std::cerr" << std::endl; +} diff --git a/testsuites/libtests/flashdev01/flashdev01.doc b/testsuites/libtests/flashdev01/flashdev01.doc new file mode 100644 index 0000000000..0638a5a842 --- /dev/null +++ b/testsuites/libtests/flashdev01/flashdev01.doc @@ -0,0 +1,11 @@ +This file describes the directives and concepts testd by this test set. + +test set name: flashdev01 + +directives: + + TBD + +concepts: + + - Ensure that the flashdev driver API works. diff --git a/testsuites/libtests/flashdev01/flashdev01.scn b/testsuites/libtests/flashdev01/flashdev01.scn new file mode 100644 index 0000000000..809ff3cd80 --- /dev/null +++ b/testsuites/libtests/flashdev01/flashdev01.scn @@ -0,0 +1,2 @@ +*** BEGIN OF TEST FLASHDEV 1 *** +*** END OF TEST FLASHDEV 1 *** diff --git a/testsuites/libtests/flashdev01/init.c b/testsuites/libtests/flashdev01/init.c new file mode 100644 index 0000000000..6ce9709496 --- /dev/null +++ b/testsuites/libtests/flashdev01/init.c @@ -0,0 +1,190 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (C) 2023 Aaron Nyholm + * + * 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. + */ + +#include "tmacros.h" + +#include "test_flashdev.h" + +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#include <sys/ioctl.h> + +#define TEST_NAME_LENGTH 10 + +#define TEST_DATA_SIZE (PAGE_SIZE * PAGE_COUNT) +#define PAGE_COUNT 16 +#define PAGE_SIZE 128 +#define WB_SIZE 1 + +const char rtems_test_name[] = "FLASHDEV 1"; + +static void run_test(void); + +static void run_test(void) { + + char buff[TEST_DATA_SIZE] = {0}; + FILE *file; + int fd; + rtems_flashdev* flash; + int status; + char* read_data; + rtems_flashdev_region e_args; + rtems_flashdev_ioctl_page_info pg_info; + rtems_flashdev_region region; + uint32_t jedec; + int page_count; + int type; + size_t wb_size; + + /* Initalize the flash device driver and flashdev */ + flash = test_flashdev_init(); + rtems_test_assert(flash != NULL); + + /* Register the flashdev as a device */ + status = rtems_flashdev_register(flash, "dev/flashdev0"); + rtems_test_assert(!status); + + /* Open the flashdev */ + file = fopen("dev/flashdev0", "r+"); + rtems_test_assert(file != NULL); + fd = fileno(file); + + /* Read data from flash */ + read_data = fgets(buff, TEST_DATA_SIZE, file); + rtems_test_assert(read_data != NULL); + + /* Fseek to start of flash */ + status = fseek(file, 0x0, SEEK_SET); + rtems_test_assert(!status); + + /* Write the test name to the flash */ + status = fwrite(rtems_test_name, TEST_NAME_LENGTH, 1, file); + rtems_test_assert(status == 1); + + /* Fseek to start of flash and read again */ + status = fseek(file, 0x0, SEEK_SET); + rtems_test_assert(!status); + fgets(buff, TEST_DATA_SIZE, file); + rtems_test_assert(!strncmp(buff, rtems_test_name, TEST_NAME_LENGTH)); + + /* Test Erasing */ + e_args.offset = 0x0; + e_args.size = PAGE_SIZE; + status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_ERASE, &e_args); + rtems_test_assert(!status); + + fseek(file, 0x0, SEEK_SET); + fgets(buff, TEST_DATA_SIZE, file); + rtems_test_assert(buff[0] == 0); + + /* Test getting JEDEC ID */ + status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_JEDEC_ID, &jedec); + rtems_test_assert(!status); + rtems_test_assert(jedec == 0x00ABCDEF); + + /* Test getting flash type */ + status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_TYPE, &type); + rtems_test_assert(!status); + rtems_test_assert(type == RTEMS_FLASHDEV_NOR); + + /* Test getting page info from offset */ + pg_info.location = PAGE_SIZE + PAGE_SIZE/2; + + status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_OFFSET, &pg_info); + rtems_test_assert(!status); + rtems_test_assert(pg_info.page_info.offset == PAGE_SIZE); + rtems_test_assert(pg_info.page_info.size == PAGE_SIZE); + + /* Test getting page info from index */ + pg_info.location = 2; + status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_PAGEINFO_BY_INDEX, &pg_info); + rtems_test_assert(!status); + rtems_test_assert(pg_info.page_info.offset == 2*PAGE_SIZE); + rtems_test_assert(pg_info.page_info.size == PAGE_SIZE); + + /* Test getting page count */ + status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_PAGE_COUNT, &page_count); + rtems_test_assert(!status); + rtems_test_assert(page_count == PAGE_COUNT); + + /* Test getting write block size */ + status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_WRITE_BLOCK_SIZE, &wb_size); + rtems_test_assert(!status); + rtems_test_assert(wb_size == WB_SIZE); + + /* Test Regions */ + region.offset = 0x400; + region.size = 0x200; + status = ioctl(fd, RTEMS_FLASHDEV_IOCTL_REGION_SET, ®ion); + rtems_test_assert(!status); + + /* Test read to larger then region */ + fseek(file, 0x0, SEEK_SET); + read_data = fgets(buff, 2048, file); + rtems_test_assert(read_data == NULL); + + /* Test fseek outside of region */ + status = fseek(file, 0x201, SEEK_SET); + rtems_test_assert(status); + + /* Write to base unset region and check the writes location */ + fseek(file, 0x0, SEEK_SET); + fwrite("HELLO WORLD", 11, 1, file); + ioctl(fd, RTEMS_FLASHDEV_IOCTL_REGION_UNSET, NULL); + fseek(file, 0x400, SEEK_SET); + fgets(buff, 11, file); + rtems_test_assert(strncmp(buff, "HELLO WORLD", 11)); +} + +static void Init(rtems_task_argument arg) +{ + TEST_BEGIN(); + + run_test(); + + TEST_END(); + rtems_test_exit(0); +} + +#define CONFIGURE_MICROSECONDS_PER_TICK 2000 + +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 7 + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 + +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT + +#include <rtems/confdefs.h> diff --git a/testsuites/libtests/flashdev01/test_flashdev.c b/testsuites/libtests/flashdev01/test_flashdev.c new file mode 100644 index 0000000000..708d708977 --- /dev/null +++ b/testsuites/libtests/flashdev01/test_flashdev.c @@ -0,0 +1,275 @@ +/* + * Copyright (C) 2023 Aaron Nyholm + * + * 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. + */ + +#include "test_flashdev.h" + +#include <stdlib.h> +#include <string.h> + +#include <rtems/seterr.h> + +#define TEST_DATA_SIZE (PAGE_SIZE * PAGE_COUNT) +#define PAGE_COUNT 16 +#define PAGE_SIZE 128 +#define WB_SIZE 1 +#define MAX_NUM_REGIONS 48 +#define BITALLOC_SIZE 32 +#define NUM_BITALLOC ((MAX_NUM_REGIONS + BITALLOC_SIZE - 1) / BITALLOC_SIZE) + +/** + * This flash device driver is for testing flashdev + * API calls. + */ +typedef struct test_flashdev { + char* data; + uint32_t jedec_id; + uint32_t bit_allocator[NUM_BITALLOC]; + rtems_flashdev_region regions[MAX_NUM_REGIONS]; +} test_flashdev; + +int test_flashdev_page_by_off( + rtems_flashdev *flash, + off_t search_offset, + off_t *page_offset, + size_t *page_size +); + +int test_flashdev_page_by_index( + rtems_flashdev *flash, + off_t search_index, + off_t *page_offset, + size_t *page_size +); + +int test_flashdev_page_count( + rtems_flashdev *flash, + int *page_count +); + +int test_flashdev_wb_size( + rtems_flashdev *flash, + size_t *write_block_size +); + +uint32_t test_flashdev_jedec_id( + rtems_flashdev* flash +); + +int test_flashdev_type( + rtems_flashdev* flash, + rtems_flashdev_flash_type* type +); + +int test_flashdev_read( + rtems_flashdev* flash, + uintptr_t offset, + size_t count, + void* buffer +); + +int test_flashdev_write( + rtems_flashdev* flash, + uintptr_t offset, + size_t count, + const void* buffer +); + +int test_flashdev_erase( + rtems_flashdev* flash, + uintptr_t offset, + size_t count +); + +/* Find page info by offset handler */ +int test_flashdev_page_by_off( + rtems_flashdev *flash, + off_t search_offset, + off_t *page_offset, + size_t *page_size +) +{ + *page_offset = search_offset - (search_offset%PAGE_SIZE); + *page_size = PAGE_SIZE; + return 0; +} + +/* Find page by index handler */ +int test_flashdev_page_by_index( + rtems_flashdev *flash, + off_t search_index, + off_t *page_offset, + size_t *page_size +) +{ + *page_offset = search_index * PAGE_SIZE; + *page_size = PAGE_SIZE; + return 0; +} + +/* Page count handler */ +int test_flashdev_page_count( + rtems_flashdev *flash, + int *page_count +) +{ + *page_count = PAGE_COUNT; + return 0; +} + +/* Write block size handler */ +int test_flashdev_wb_size( + rtems_flashdev *flash, + size_t *write_block_size +) +{ + *write_block_size = WB_SIZE; + return 0; +} + +/* JEDEC ID handler, this would normally require a READID + * call to the physical flash device. + */ +uint32_t test_flashdev_jedec_id( + rtems_flashdev* flash +) +{ + test_flashdev* driver = flash->driver; + return driver->jedec_id; +} + +/* Function to identify what kind of flash is attached. */ +int test_flashdev_type( + rtems_flashdev *flash, + rtems_flashdev_flash_type *type +) +{ + *type = RTEMS_FLASHDEV_NOR; + return 0; +} + +/* Read flash call. Any offset or count protections are + * required to be done in the driver function. */ +int test_flashdev_read( + rtems_flashdev* flash, + uintptr_t offset, + size_t count, + void* buffer +) +{ + test_flashdev* driver = flash->driver; + + if (offset + count > TEST_DATA_SIZE) { + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + memcpy(buffer, &driver->data[offset], count); + return 0; +} + +/* Write Flash call. Any offset or count protections are + * required to be done in the driver function. */ +int test_flashdev_write( + rtems_flashdev* flash, + uintptr_t offset, + size_t count, + const void* buffer +) +{ + test_flashdev* driver = flash->driver; + + if (offset + count > TEST_DATA_SIZE) { + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + memcpy(&driver->data[offset], buffer, count); + return 0; +} + +/* Erase Flash call. Any offset or count protections are + * required to be done in the driver function. */ +int test_flashdev_erase( + rtems_flashdev* flash, + uintptr_t offset, + size_t count +) +{ + test_flashdev* driver = flash->driver; + + if (offset + count > TEST_DATA_SIZE) { + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + if (offset%PAGE_SIZE || count%PAGE_SIZE) { + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + memset(&driver->data[offset], 0, count); + return 0; +} + +/* Initialize Flashdev and underlying driver. */ +rtems_flashdev* test_flashdev_init(void) +{ + rtems_flashdev *flash = rtems_flashdev_alloc_and_init(sizeof(rtems_flashdev)); + + if (flash == NULL) { + return NULL; + } + + test_flashdev* flash_driver = calloc(1, sizeof(test_flashdev)); + + if (flash_driver == NULL) { + rtems_flashdev_destroy_and_free(flash); + return NULL; + } + + flash_driver->data = calloc(1, TEST_DATA_SIZE); + if (flash_driver->data == NULL) { + free(flash_driver); + rtems_flashdev_destroy_and_free(flash); + return NULL; + } + + flash_driver->jedec_id = 0x00ABCDEF; + + rtems_flashdev_region_table *ftable = calloc(1, sizeof(rtems_flashdev_region_table)); + ftable->max_regions = MAX_NUM_REGIONS; + ftable->regions = flash_driver->regions; + ftable->bit_allocator = flash_driver->bit_allocator; + + flash->driver = flash_driver; + flash->read = &test_flashdev_read; + flash->write = &test_flashdev_write; + flash->erase = &test_flashdev_erase; + flash->jedec_id = &test_flashdev_jedec_id; + flash->flash_type = &test_flashdev_type; + flash->page_info_by_offset = &test_flashdev_page_by_off; + flash->page_info_by_index = &test_flashdev_page_by_index; + flash->page_count = &test_flashdev_page_count; + flash->write_block_size = &test_flashdev_wb_size; + flash->region_table = ftable; + + return flash; +} diff --git a/testsuites/libtests/flashdev01/test_flashdev.h b/testsuites/libtests/flashdev01/test_flashdev.h new file mode 100644 index 0000000000..8b03959c42 --- /dev/null +++ b/testsuites/libtests/flashdev01/test_flashdev.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2023 Aaron Nyholm + * + * 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. + */ + +#ifndef __TEST_FLASHDEV_H +#define __TEST_FLASHDEV_H + +#include <dev/flash/flashdev.h> + +rtems_flashdev* test_flashdev_init(void); + +#endif /* __TEST_FLASHDEV_H */ diff --git a/testsuites/libtests/flashdisk01/flashdisk01.doc b/testsuites/libtests/flashdisk01/flashdisk01.doc index 9c2e8b594a..a3c4906784 100644 --- a/testsuites/libtests/flashdisk01/flashdisk01.doc +++ b/testsuites/libtests/flashdisk01/flashdisk01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 2014. # On-Line Applications Research Corporation (OAR). # Cynthia Rempel <cynthia@rtems.org> -# 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. diff --git a/testsuites/libtests/flashdisk01/init.c b/testsuites/libtests/flashdisk01/init.c index b85279aa6b..da9fc2a5b5 100644 --- a/testsuites/libtests/flashdisk01/init.c +++ b/testsuites/libtests/flashdisk01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/flashdisk01/test-file-system.c b/testsuites/libtests/flashdisk01/test-file-system.c index 206202008c..f8c87fb8ad 100644 --- a/testsuites/libtests/flashdisk01/test-file-system.c +++ b/testsuites/libtests/flashdisk01/test-file-system.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2010-2012 embedded brains GmbH. All rights reserved. + * Copyright (C) 2010, 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <info@embedded-brains.de> + * 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. * - * 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. + * 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. */ #include "test-file-system.h" diff --git a/testsuites/libtests/flashdisk01/test-file-system.h b/testsuites/libtests/flashdisk01/test-file-system.h index ff7b807ab9..b592ac7dca 100644 --- a/testsuites/libtests/flashdisk01/test-file-system.h +++ b/testsuites/libtests/flashdisk01/test-file-system.h @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2010-2012 embedded brains GmbH. All rights reserved. + * Copyright (C) 2010, 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <info@embedded-brains.de> + * 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. * - * 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. + * 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. */ #ifndef TEST_FILE_SYSTEM_H diff --git a/testsuites/libtests/ftp01/ftp01.doc b/testsuites/libtests/ftp01/ftp01.doc deleted file mode 100644 index 99601ddf5b..0000000000 --- a/testsuites/libtests/ftp01/ftp01.doc +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2011 embedded brains GmbH. All rights reserved. -# -# embedded brains GmbH -# Obere Lagerstr. 30 -# 82178 Puchheim -# Germany -# <rtems@embedded-brains.de> -# -# 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. - -This file describes the directives and concepts tested by this test set. - -test set name: ftp - -directives: - - FTP server and client - -concepts: - -+ Check if FTP server and client works. diff --git a/testsuites/libtests/ftp01/ftp01.scn b/testsuites/libtests/ftp01/ftp01.scn deleted file mode 100644 index 78fe236b60..0000000000 --- a/testsuites/libtests/ftp01/ftp01.scn +++ /dev/null @@ -1,97 +0,0 @@ -*** BEGIN OF TEST FTP 1 *** -*** TEST VERSION: 5.0.0.b38887ad22e2e28c15b4e248dac72f6eaff8cb13 -*** TEST STATE: EXPECTED_PASS -*** TEST BUILD: RTEMS_NETWORKING -*** TEST TOOLS: 7.3.0 20180125 (RTEMS 5, RSB 9670d7541e0621915e521fe76e7bb33de8cee661, Newlib d13c84eb07e35984bf7a974cd786a6cdac29e6b9) -syslog: ftpd: FTP daemon started (2 sessions max) -220 RTEMS FTP server (Version 1.1-JWJ) ready. -login check (1): user "anonymous" -USER anonymous -230 User logged in. -TYPE I -200 Type set to I. -SIZE a.txt -550 Could not get file size. -PASV -227 Entering passive mode (127,0,0,1,4,1). -STOR a.txt -150 Opening BINARY mode data connection. -226 Transfer complete. -QUIT -221 Goodbye. -220 RTEMS FTP server (Version 1.1-JWJ) ready. -login check (1): user "anonymous" -USER anonymous -230 User logged in. -TYPE I -200 Type set to I. -SIZE a.txt -213 1102 -PASV -227 Entering passive mode (127,0,0,1,4,4). -RETR a.txt -150 Opening BINARY mode data connection. -220 RTEMS FTP server (Version 1.1-JWJ) ready. -login check (1): user "user" -USER user -331 User name okay, need password. -login check (2): user "user", pass "pass" -PASS pass -230 User logged in. -TYPE I -200 Type set to I. -SIZE b.txt -550 Could not get file size. -PASV -227 Entering passive mode (127,0,0,1,4,7). -STOR b.txt -150 Opening BINARY mode data connection. -226 Transfer complete. -226 Transfer complete. -QUIT -221 Goodbye. -QUIT -221 Goodbye. -220 RTEMS FTP server (Version 1.1-JWJ) ready. -login check (1): user "user" -USER user -331 User name okay, need password. -login check (2): user "user", pass "pass" -PASS pass -230 User logged in. -TYPE I -200 Type set to I. -SIZE b.txt -213 1102 -PASV -227 Entering passive mode (127,0,0,1,4,10). -RETR b.txt -150 Opening BINARY mode data connection. -226 Transfer complete. -QUIT -221 Goodbye. -220 RTEMS FTP server (Version 1.1-JWJ) ready. -login check (1): user "anonymous" -USER anonymous -230 User logged in. -TYPE I -200 Type set to I. -SIZE a.txt -213 1102 -QUIT -221 Goodbye. -220 RTEMS FTP server (Version 1.1-JWJ) ready. -login check (1): user "user" -USER user -331 User name okay, need password. -login check (2): user "user", pass "pass" -PASS pass -230 User logged in. -TYPE I -200 Type set to I. -SIZE b.txt -213 1102 -QUIT -221 Goodbye. - -*** END OF TEST FTP 1 *** diff --git a/testsuites/libtests/ftp01/init.c b/testsuites/libtests/ftp01/init.c deleted file mode 100644 index aa9193873c..0000000000 --- a/testsuites/libtests/ftp01/init.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2011, 2018 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> - -#include <rtems.h> -#include <tmacros.h> - -#include <rtems/rtems_bsdnet.h> -#include <rtems/ftpd.h> -#include <rtems/ftpfs.h> - -const char rtems_test_name[] = "FTP 1"; - -/* forward declarations to avoid warnings */ -static rtems_task Init(rtems_task_argument argument); - -struct rtems_bsdnet_config rtems_bsdnet_config; - -#define FTP_WORKER_TASK_COUNT 2 - -#define FTP_WORKER_TASK_EXTRA_STACK (FTP_WORKER_TASK_COUNT * FTPD_STACKSIZE) - -static bool login_check(const char *user, const char *pass) -{ - rtems_test_assert( - strcmp(user, "anonymous") == 0 || strcmp(user, "user") == 0 - ); - - if (pass != NULL) { - rtems_test_assert( - strcmp(pass, "anonymous") == 0 || strcmp(pass, "pass") == 0 - ); - printf("login check (2): user \"%s\", pass \"%s\"\n", user, pass); - return true; - } else { - printf("login check (1): user \"%s\"\n", user); - return strcmp(user, "anonymous") == 0; - } -} - -struct rtems_ftpd_configuration rtems_ftpd_configuration = { - .priority = 90, - .max_hook_filesize = 0, - .port = 21, - .hooks = NULL, - .root = NULL, - .tasks_count = FTP_WORKER_TASK_COUNT, - .idle = 0, - .login = login_check, - .access = 0 -}; - -static const char content [] = -" LICENSE INFORMATION\n" -"\n" -"RTEMS is free software; you can redistribute it and/or modify it under\n" -"terms of the GNU General Public License as published by the\n" -"Free Software Foundation; either version 2, or (at your option) any\n" -"later version. RTEMS is distributed in the hope that it will be useful,\n" -"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" -"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" -"General Public License for more details. You should have received\n" -"a copy of the GNU General Public License along with RTEMS; see\n" -"file COPYING. If not, write to the Free Software Foundation, 675\n" -"Mass Ave, Cambridge, MA 02139, USA.\n" -"\n" -"As a special exception, including RTEMS header files in a file,\n" -"instantiating RTEMS generics or templates, or linking other files\n" -"with RTEMS objects to produce an executable application, does not\n" -"by itself cause the resulting executable application to be covered\n" -"by the GNU General Public License. This exception does not\n" -"however invalidate any other reasons why the executable file might be\n" -"covered by the GNU Public License.\n"; - -static void initialize_ftpfs(void) -{ - rtems_status_code sc = RTEMS_SUCCESSFUL; - int rv = 0; - struct timeval to = { - .tv_sec = 10, - .tv_usec = 0 - }; - const char *target = RTEMS_FTPFS_MOUNT_POINT_DEFAULT; - - rv = mount_and_make_target_path( - NULL, - target, - RTEMS_FILESYSTEM_TYPE_FTPFS, - RTEMS_FILESYSTEM_READ_WRITE, - NULL - ); - rtems_test_assert(rv == 0); - - sc = rtems_ftpfs_set_verbose(target, true); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - - sc = rtems_ftpfs_set_timeout(target, &to); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); -} - -static void change_self_priority(void) -{ - rtems_status_code sc = RTEMS_SUCCESSFUL; - rtems_task_priority cur = 0; - - sc = rtems_task_set_priority(RTEMS_SUCCESSFUL, 110, &cur); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); -} - -static void create_file(const char *path, const void *begin, size_t size) -{ - int rv = 0; - int fd = open(path, O_WRONLY); - ssize_t n = 0; - - rtems_test_assert(fd >= 0); - - n = write(fd, begin, size); - rtems_test_assert(n == (ssize_t) size); - - rv = close(fd); - rtems_test_assert(rv == 0); -} - -static void copy_file(const char *src_path, const char *dest_path) -{ - int rv = 0; - int in = open(src_path, O_RDONLY); - int out = open(dest_path, O_WRONLY); - ssize_t n_in = 0; - char buf [64]; - struct stat st_in; - struct stat st_out; - - memset(&st_in, 0xff, sizeof(st_in)); - memset(&st_out, 0xff, sizeof(st_out)); - - rtems_test_assert(in >= 0); - rtems_test_assert(out >= 0); - - rv = fstat(out, &st_out); - rtems_test_assert(rv == 0); - - rtems_test_assert(st_out.st_size == 0); - - while ((n_in = read(in, buf, sizeof(buf))) > 0) { - ssize_t n_out = write(out, buf, (size_t) n_in); - rtems_test_assert(n_out == n_in); - } - - rv = fstat(out, &st_out); - rtems_test_assert(rv == 0); - - rv = fstat(in, &st_in); - rtems_test_assert(rv == 0); - - rtems_test_assert(st_in.st_size == st_out.st_size); - - rv = close(out); - rtems_test_assert(rv == 0); - - rv = close(in); - rtems_test_assert(rv == 0); -} - -static void check_file_size(const char *path, size_t size) -{ - struct stat st; - int rv = lstat(path, &st); - - rtems_test_assert(rv == 0); - rtems_test_assert(st.st_size == (off_t) size); -} - -static void check_file(const char *path) -{ - int rv = 0; - int fd = open(path, O_RDONLY); - ssize_t n = 0; - char buf [64]; - const char *current = &content [0]; - size_t done = 0; - - rtems_test_assert(fd >= 0); - - while ((n = read(fd, buf, sizeof(buf))) > 0) { - done += (size_t) n; - rtems_test_assert(done <= sizeof(content)); - rtems_test_assert(memcmp(current, buf, (size_t) n) == 0); - current += (size_t) n; - } - - rtems_test_assert(done == sizeof(content)); - - rv = close(fd); - rtems_test_assert(rv == 0); -} - -static void test(void) -{ - int rv = 0; - const char file_a [] = "/FTP/127.0.0.1/a.txt"; - const char file_b [] = "/FTP/user:pass@127.0.0.1/b.txt"; - - rv = rtems_bsdnet_initialize_network(); - rtems_test_assert(rv == 0); - - rv = rtems_initialize_ftpd(); - rtems_test_assert(rv == 0); - - initialize_ftpfs(); - change_self_priority(); - create_file(file_a, &content [0], sizeof(content)); - copy_file(file_a, file_b); - check_file(file_b); - check_file_size(file_a, sizeof(content)); - check_file_size(file_b, sizeof(content)); -} - -static rtems_task Init(rtems_task_argument argument) -{ - TEST_BEGIN(); - test(); - TEST_END(); - - rtems_test_exit(0); -} - -#define CONFIGURE_INIT - -#define CONFIGURE_MICROSECONDS_PER_TICK 10000 - -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 14 - -#define CONFIGURE_FILESYSTEM_FTPFS - -#define CONFIGURE_MAXIMUM_TASKS (3 + FTP_WORKER_TASK_COUNT) -#define CONFIGURE_MAXIMUM_SEMAPHORES 2 - -#define CONFIGURE_EXTRA_TASK_STACKS FTP_WORKER_TASK_EXTRA_STACK - -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT - -#include <rtems/confdefs.h> diff --git a/testsuites/libtests/getentropy01/init.c b/testsuites/libtests/getentropy01/init.c index 4986ddfa86..afdd0c88c1 100644 --- a/testsuites/libtests/getentropy01/init.c +++ b/testsuites/libtests/getentropy01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2017 embedded brains GmbH. All rights reserved. + * Copyright (c) 2017 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/gxx01/gxx01.doc b/testsuites/libtests/gxx01/gxx01.doc deleted file mode 100644 index 568e26f49a..0000000000 --- a/testsuites/libtests/gxx01/gxx01.doc +++ /dev/null @@ -1,33 +0,0 @@ -# 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. -# - -This file describes the directives and concepts tested by this test set. - -test set name: gxx01 - -directives: - - rtems_gxx_once - rtems_gxx_key_create - rtems_gxx_key_delete - rtems_gxx_getspecific - rtems_gxx_setspecific - rtems_gxx_mutex_init - rtems_gxx_mutex_lock - rtems_gxx_mutex_destroy - rtems_gxx_mutex_trylock - rtems_gxx_mutex_unlock - rtems_gxx_recursive_mutex_init - rtems_gxx_recursive_mutex_lock - rtems_gxx_recursive_mutex_trylock - rtems_gxx_recursive_mutex_unlock - -concepts: - -+ Fully exercise wrappers provided by RTEMS for GCC's C++ library's - mutual exclusion implementation. diff --git a/testsuites/libtests/gxx01/gxx01.scn b/testsuites/libtests/gxx01/gxx01.scn deleted file mode 100644 index f831881fa3..0000000000 --- a/testsuites/libtests/gxx01/gxx01.scn +++ /dev/null @@ -1,35 +0,0 @@ -*** TEST GXX 01 *** -rtems_gxx_mutex_init() - OK -rtems_gxx_mutex_trylock() - OK -rtems_gxx_mutex_unlock() - OK -rtems_gxx_mutex_lock() - OK -rtems_gxx_mutex_unlock() - OK - -rtems_gxx_recursive_mutex_init() - OK -rtems_gxx_recursive_mutex_trylock() - OK -rtems_gxx_recursive_mutex_trylock() - Nest -rtems_gxx_recursive_mutex_unlock() - Unnest -rtems_gxx_recursive_mutex_unlock() - OK -rtems_gxx_recursive_mutex_lock() - OK -rtems_gxx_recursive_mutex_unlock() - OK -rtems_gxx_mutex_destroy(mutex) - OK -rtems_gxx_mutex_destroy(mutex) - NOT OK - -Call once method the first time -Running once method -Call once method the second time - -rtems_gxx_key_create(&key, NULL) - OK -rtems_gxx_key_delete(key) - OK -rtems_gxx_key_create(&key, key_dtor) - OK -rtems_gxx_getspecific(key) not set - OK -rtems_gxx_setspecific(key, 0x1234) - OK -rtems_gxx_getspecific(key) already existing - OK -rtems_gxx_key_delete(key) - OK -rtems_gxx_getspecific(key) non-existent - OK -rtems_gxx_key_delete(key) - NOT OK -rtems_gxx_setspecific(NULL, 0x1234) - NOT OK -rtems_gxx_getspecific(NULL) - OK -rtems_gxx_key_delete(NULL) - NOT OK - -*** END OF TEST GXX 01 *** diff --git a/testsuites/libtests/gxx01/init.c b/testsuites/libtests/gxx01/init.c deleted file mode 100644 index 306e4f1f0b..0000000000 --- a/testsuites/libtests/gxx01/init.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <errno.h> -#include <tmacros.h> -#include "test_support.h" -#include <rtems/gxx_wrappers.h> - -const char rtems_test_name[] = "GXX 1"; - -/* forward declarations to avoid warnings */ -rtems_task Init(rtems_task_argument argument); -void test_recursive_mutex(void); -void test_mutex(void); -void once_function(void); -void test_once(void); -void key_dtor(void *ptr); -void test_key(void); - -void test_recursive_mutex(void) -{ - int sc; - __gthread_mutex_t mutex; - - mutex = 0; - puts( "rtems_gxx_recursive_mutex_init() - OK" ); - rtems_gxx_recursive_mutex_init(&mutex); - rtems_test_assert( mutex != 0 ); - - puts( "rtems_gxx_recursive_mutex_trylock() - OK" ); - sc = rtems_gxx_recursive_mutex_trylock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_trylock() - Nest" ); - sc = rtems_gxx_recursive_mutex_trylock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_unlock() - Unnest" ); - sc = rtems_gxx_recursive_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_unlock() - OK" ); - sc = rtems_gxx_recursive_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_lock() - OK" ); - sc = rtems_gxx_recursive_mutex_lock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_recursive_mutex_unlock() - OK" ); - sc = rtems_gxx_recursive_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_destroy(mutex) - OK" ); - sc = rtems_gxx_mutex_destroy(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_destroy(mutex) - NOT OK" ); - sc = rtems_gxx_mutex_destroy(&mutex); - rtems_test_assert( sc == -1 ); -} - -void test_mutex(void) -{ - int sc; - __gthread_mutex_t mutex; - - mutex = 0; - puts( "rtems_gxx_mutex_init() - OK" ); - rtems_gxx_mutex_init(&mutex); - rtems_test_assert( mutex != 0 ); - - puts( "rtems_gxx_mutex_trylock() - OK" ); - sc = rtems_gxx_mutex_trylock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_unlock() - OK" ); - sc = rtems_gxx_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_lock() - OK" ); - sc = rtems_gxx_mutex_lock(&mutex); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_mutex_unlock() - OK" ); - sc = rtems_gxx_mutex_unlock(&mutex); - rtems_test_assert( sc == 0 ); -} - -void once_function(void) -{ - puts( "Running once method" ); -} - -void test_once(void) -{ - __gthread_once_t once; - int sc; - - once = 0; - - puts( "Call once method the first time" ); - sc = rtems_gxx_once(&once, once_function); - rtems_test_assert( sc == 0 ); - - puts( "Call once method the second time" ); - sc = rtems_gxx_once(&once, once_function); - rtems_test_assert( sc == 0 ); -} - -volatile bool key_dtor_ran; - -void key_dtor(void *ptr) -{ - key_dtor_ran = true; -} - -void test_key(void) -{ - int sc; - __gthread_key_t key; - void *p; - - puts( "rtems_gxx_key_create(&key, NULL) - OK" ); - sc = rtems_gxx_key_create(&key, NULL); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_key_delete(key) - OK" ); - sc = rtems_gxx_key_delete(key); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_key_create(&key, key_dtor) - OK" ); - sc = rtems_gxx_key_create(&key, key_dtor); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_getspecific(key) not set - OK" ); - p = rtems_gxx_getspecific(key); - rtems_test_assert( p == NULL ); - - puts( "rtems_gxx_setspecific(key, 0x1234) - OK" ); - sc = rtems_gxx_setspecific(key, (void *)0x1234); - rtems_test_assert( sc == 0 ); - - puts( "rtems_gxx_getspecific(key) already existing - OK" ); - p = rtems_gxx_getspecific(key); - rtems_test_assert( p == (void *)0x1234 ); - - puts( "rtems_gxx_key_delete(key) - OK" ); - sc = rtems_gxx_key_delete(key); - rtems_test_assert( sc == 0 ); - /* pthread_key man-page: the dtor should _not_ be called */ - rtems_test_assert( key_dtor_ran != true ); - - key = calloc( 1, sizeof( *key ) ); - rtems_test_assert( key != NULL ); - - puts( "rtems_gxx_getspecific(key) non-existent - OK" ); - p = rtems_gxx_getspecific( key ); - rtems_test_assert( p == NULL ); - - puts( "rtems_gxx_key_delete(key) - NOT OK" ); - sc = rtems_gxx_key_delete( key ); - rtems_test_assert( sc != 0 ); - - puts( "rtems_gxx_setspecific(NULL, 0x1234) - NOT OK" ); - sc = rtems_gxx_setspecific( NULL, (void *)0x1234 ); - rtems_test_assert( sc == EINVAL ); - - puts( "rtems_gxx_getspecific(NULL) - OK" ); - p = rtems_gxx_getspecific( NULL ); - rtems_test_assert( p == NULL ); - - puts( "rtems_gxx_key_delete(NULL) - NOT OK" ); - sc = rtems_gxx_key_delete( NULL ); - rtems_test_assert( sc == EINVAL ); -} - -rtems_task Init( - rtems_task_argument argument -) -{ - TEST_BEGIN(); - - test_mutex(); - puts( "" ); - - test_recursive_mutex(); - puts( "" ); - - test_once(); - puts( "" ); - - test_key(); - puts( "" ); - - TEST_END(); - - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_KEYS 1 -#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1 - -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 2 -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include <rtems/confdefs.h> -/* end of file */ diff --git a/testsuites/libtests/heapwalk/init.c b/testsuites/libtests/heapwalk/init.c index cd5caaa852..2864feac28 100644 --- a/testsuites/libtests/heapwalk/init.c +++ b/testsuites/libtests/heapwalk/init.c @@ -1,14 +1,33 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Test of Heap Walker * * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * - * Copyright (c) 2009 embedded brains GmbH. + * Copyright (c) 2009 embedded brains GmbH & Co. KG + * + * 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. * - * 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. + * 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/libtests/heapwalk/system.h b/testsuites/libtests/heapwalk/system.h index 53a13fc1d6..adf3f4a678 100644 --- a/testsuites/libtests/heapwalk/system.h +++ b/testsuites/libtests/heapwalk/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <tmacros.h> diff --git a/testsuites/libtests/i2c01/init.c b/testsuites/libtests/i2c01/init.c index 83027ed548..452bea4ac1 100644 --- a/testsuites/libtests/i2c01/init.c +++ b/testsuites/libtests/i2c01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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 @@ -336,6 +349,124 @@ static void test_simple_read_write(test_bus *bus, int fd) rtems_test_assert(memcmp(&buf[0], &abc[0], sizeof(buf)) == 0); } +typedef struct { + rtems_id caller; + int fd; +} bus_obtainer_ctx; + +static void bus_obtainer_task(rtems_task_argument arg) +{ + rtems_event_set e = 0; + bus_obtainer_ctx *c = (bus_obtainer_ctx *) arg; + int rv; + rtems_status_code sc; + + rv = ioctl(c->fd, I2C_BUS_OBTAIN); + rtems_test_assert(rv == 0); + + sc = rtems_event_send(c->caller, RTEMS_EVENT_1); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_event_receive( + RTEMS_EVENT_1, + RTEMS_EVENT_ANY | RTEMS_WAIT, + 100, + &e + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + rv = ioctl(c->fd, I2C_BUS_RELEASE); + rtems_test_assert(rv == 0); + + sc = rtems_event_send(c->caller, RTEMS_EVENT_1); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +static void test_nonblock_read_write(test_bus *bus, int fd) +{ + int flags; + int rv; + char buf[3]; + ssize_t n; + i2c_msg msgs[] = {{ + .addr = 1, + .flags = I2C_M_STOP, + .len = sizeof(buf), + .buf = (uint8_t *) buf, + }}; + struct i2c_rdwr_ioctl_data payload = { + .msgs = msgs, + .nmsgs = sizeof(msgs)/sizeof(msgs[0]), + }; + rtems_id id; + rtems_event_set e = 0; + bus_obtainer_ctx ctx = { + .caller = rtems_task_self(), + .fd = fd, + }; + rtems_status_code sc; + + flags = fcntl(fd, F_GETFL, 0); + rtems_test_assert(flags > 0); + + rv = fcntl(fd, F_SETFL, flags | O_NONBLOCK); + rtems_test_assert(rv != -1); + + sc = rtems_task_create( + rtems_build_name('O', 'B', 'T', 'A'), + 2, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &id + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_task_start( + id, + bus_obtainer_task, + (rtems_task_argument) &ctx + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_event_receive( + RTEMS_EVENT_1, + RTEMS_EVENT_ANY | RTEMS_WAIT, + 100, + &e + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + errno = 0; + n = read(fd, &buf[0], sizeof(buf)); + rtems_test_assert(n == -1); + rtems_test_assert(errno == EAGAIN); + + errno = 0; + n = write(fd, &buf[0], sizeof(buf)); + rtems_test_assert(n == -1); + rtems_test_assert(errno == EAGAIN); + + errno = 0; + rv = ioctl(fd, I2C_RDWR, &payload); + rtems_test_assert(rv == -1); + rtems_test_assert(errno == EAGAIN); + + sc = rtems_event_send(id, RTEMS_EVENT_1); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_event_receive( + RTEMS_EVENT_1, + RTEMS_EVENT_ANY | RTEMS_WAIT, + 100, + &e + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_delete(id); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + rv = fcntl(fd, F_SETFL, flags); + rtems_test_assert(rv != -1); +} + static void test_gpio_nxp_pca9535(void) { int rv; @@ -627,6 +758,7 @@ static void test(void) rtems_test_assert(bus->base.timeout == 0); test_simple_read_write(bus, fd); + test_nonblock_read_write(bus, fd); test_eeprom(bus); test_gpio_nxp_pca9535(); test_switch_nxp_pca9548a(); @@ -657,7 +789,7 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 7 -#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_SEMAPHORES 1 diff --git a/testsuites/libtests/irqs01/init.c b/testsuites/libtests/irqs01/init.c new file mode 100644 index 0000000000..604aaf1f22 --- /dev/null +++ b/testsuites/libtests/irqs01/init.c @@ -0,0 +1,299 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2020 embedded brains GmbH & Co. KG + * + * 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 <rtems/test.h> +#include <rtems/test-info.h> + +#include <rtems.h> +#include <rtems/irq-extension.h> + +typedef struct { + rtems_interrupt_server_control base; + int magic; +} server_control; + +static void destroy(rtems_interrupt_server_control *base) +{ + server_control *control; + + control = (server_control *) base; + T_step_eq_int(2, control->magic, 0x54192a88); +} + +static const rtems_interrupt_server_config valid_config = { + .name = rtems_build_name('N', 'A', 'M', 'E'), + .priority = 123, + .storage_size = RTEMS_MINIMUM_STACK_SIZE, + .modes = RTEMS_DEFAULT_MODES, + .attributes = RTEMS_DEFAULT_ATTRIBUTES, + .destroy = destroy +}; + +T_TEST_CASE(InterruptServerCreateDestroy) +{ + server_control control; + rtems_status_code sc; + uint32_t server_index; + rtems_task_priority prio; + + T_plan(7); + + memset(&control, 0xff, sizeof(control)); + control.magic = 0x54192a88; + server_index = 0x2833763f; + + sc = rtems_interrupt_server_create( + &control.base, + &valid_config, + &server_index + ); + T_step_rsc_success(0, sc); + T_step_ne_u32(1, server_index, 0x2833763f); + + sc = rtems_interrupt_server_delete(server_index); + T_step_rsc_success(3, sc); + + /* Make sure the interrupt server terminated */ + prio = 0; + sc = rtems_task_set_priority(RTEMS_SELF, 124, &prio); + T_step_rsc_success(4, sc); + sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio); + T_step_rsc_success(5, sc); + T_step_eq_u32(6, prio, 124); +} + +static const rtems_interrupt_server_config invalid_config = { + .name = rtems_build_name('N', 'A', 'M', 'E'), + .priority = 0, + .storage_size = RTEMS_MINIMUM_STACK_SIZE, + .modes = RTEMS_DEFAULT_MODES, + .attributes = RTEMS_DEFAULT_ATTRIBUTES, + .destroy = destroy +}; + +T_TEST_CASE(InterruptServerCreateError) +{ + rtems_interrupt_server_control control; + rtems_interrupt_server_control control_2; + rtems_status_code sc; + uint32_t server_index; + + memset(&control, 0xff, sizeof(control)); + memset(&control_2, 0xff, sizeof(control_2)); + server_index = 0x235e8766; + + sc = rtems_interrupt_server_create(&control, &invalid_config, &server_index); + T_rsc(sc, RTEMS_INVALID_PRIORITY); + T_eq_mem(&control, &control_2, sizeof(control)); + T_eq_u32(server_index, 0x235e8766); +} + +static const rtems_interrupt_server_config request_config = { + .name = rtems_build_name('N', 'A', 'M', 'E'), + .priority = 123, + .storage_size = RTEMS_MINIMUM_STACK_SIZE, + .modes = RTEMS_DEFAULT_MODES, + .attributes = RTEMS_DEFAULT_ATTRIBUTES +}; + +static void not_called(void *arg) +{ + (void) arg; + T_unreachable(); +} + +static void request(void *arg) +{ + rtems_id *id; + rtems_status_code sc; + + id = arg; + T_step(4); + sc = rtems_event_transient_send(*id); + T_step_rsc_success(6, sc); +} + +T_TEST_CASE(InterruptServerRequest) +{ + rtems_interrupt_server_control control; + rtems_interrupt_server_request req; + rtems_status_code sc; + uint32_t server_index; + rtems_id id; + rtems_task_priority prio; + + T_plan(11); + + memset(&control, 0xff, sizeof(control)); + memset(&req, 0xff, sizeof(req)); + server_index = 0x99d225bd; + + sc = rtems_interrupt_server_create( + &control, + &request_config, + &server_index + ); + T_step_rsc_success(0, sc); + T_step_ne_u32(1, server_index, 0x99d225bd); + + sc = rtems_interrupt_server_request_initialize( + server_index, + &req, + not_called, + NULL + ); + T_step_rsc_success(2, sc); + + rtems_interrupt_server_request_submit(&req); + rtems_interrupt_server_request_destroy(&req); + + id = rtems_task_self(); + sc = rtems_interrupt_server_request_initialize( + server_index, + &req, + request, + &id + ); + T_step_rsc_success(3, sc); + + rtems_interrupt_server_request_submit(&req); + sc = rtems_event_transient_receive(RTEMS_WAIT, RTEMS_NO_TIMEOUT); + T_step_rsc_success(5, sc); + + rtems_interrupt_server_request_destroy(&req); + + sc = rtems_interrupt_server_delete(server_index); + T_step_rsc_success(7, sc); + + /* Make sure the interrupt server terminated */ + prio = 0; + sc = rtems_task_set_priority(RTEMS_SELF, 124, &prio); + T_step_rsc_success(8, sc); + sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio); + T_step_rsc_success(9, sc); + T_step_eq_u32(10, prio, 124); +} + +T_TEST_CASE(InterruptServerInitializeDestroy) +{ + rtems_status_code sc; + uint32_t server_count; + rtems_task_priority prio; + + sc = rtems_interrupt_server_delete(0); + T_rsc(sc, RTEMS_INVALID_ID); + + server_count = 456; + sc = rtems_interrupt_server_initialize( + 123, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &server_count + ); + T_rsc_success(sc); + T_eq_u32(server_count, 1); + + server_count = 456; + sc = rtems_interrupt_server_initialize( + 123, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &server_count + ); + T_rsc(sc, RTEMS_INCORRECT_STATE); + T_eq_u32(server_count, 0); + + sc = rtems_interrupt_server_delete(0); + T_rsc_success(sc); + + /* Make sure the interrupt server terminated */ + prio = 0; + sc = rtems_task_set_priority(RTEMS_SELF, 124, &prio); + T_rsc_success(sc); + sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio); + T_rsc_success(sc); + T_eq_u32(prio, 124); + + server_count = 456; + sc = rtems_interrupt_server_initialize( + 0, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &server_count + ); + T_rsc(sc, RTEMS_INVALID_PRIORITY); + T_eq_u32(server_count, 0); + + server_count = 456; + sc = rtems_interrupt_server_initialize( + 123, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &server_count + ); + T_rsc_success(sc); + T_eq_u32(server_count, 1); + + sc = rtems_interrupt_server_delete(0); + T_rsc_success(sc); + + /* Make sure the interrupt server terminated */ + prio = 0; + sc = rtems_task_set_priority(RTEMS_SELF, 124, &prio); + T_rsc_success(sc); + sc = rtems_task_set_priority(RTEMS_SELF, prio, &prio); + T_rsc_success(sc); + T_eq_u32(prio, 124); +} + +const char rtems_test_name[] = "IRQS 1"; + +static void Init(rtems_task_argument argument) +{ + rtems_test_run(argument, TEST_STATE); +} + +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES + +#define CONFIGURE_INIT + +#include <rtems/confdefs.h> diff --git a/testsuites/libtests/irqs01/irqs01.doc b/testsuites/libtests/irqs01/irqs01.doc new file mode 100644 index 0000000000..29f9ad64ad --- /dev/null +++ b/testsuites/libtests/irqs01/irqs01.doc @@ -0,0 +1,16 @@ +This file describes the directives and concepts tested by this test set. + +test set name: irqs01 + +directives: + + - rtems_interrupt_server_create() + - rtems_interrupt_server_delete() + - rtems_interrupt_server_initialize() + - rtems_interrupt_server_request_destroy() + - rtems_interrupt_server_request_initialize() + - rtems_interrupt_server_request_submit() + +concepts: + + - Ensure that the interrupt server works. diff --git a/testsuites/libtests/libfdt01/init.c b/testsuites/libtests/libfdt01/init.c index b1568d9c04..6f369daf82 100644 --- a/testsuites/libtests/libfdt01/init.c +++ b/testsuites/libtests/libfdt01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2015 embedded brains GmbH. All rights reserved. + * Copyright (c) 2015 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/libfdt01/some.c b/testsuites/libtests/libfdt01/some.c index 5eed911204..d5d8b7a285 100644 --- a/testsuites/libtests/libfdt01/some.c +++ b/testsuites/libtests/libfdt01/some.c @@ -4,9 +4,9 @@ * WARNING: Automatically generated -- do not edit! */ -#include <sys/types.h> +#include <rtems.h> -const unsigned char some_bin[] = { +RTEMS_ALIGNED(8) const unsigned char some_bin[] = { 0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, diff --git a/testsuites/libtests/libfdt01/some.dts b/testsuites/libtests/libfdt01/some.dts index ac15825b17..c4c7d926c6 100644 --- a/testsuites/libtests/libfdt01/some.dts +++ b/testsuites/libtests/libfdt01/some.dts @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2015 embedded brains GmbH. All rights reserved. + * Copyright (c) 2015 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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. */ /dts-v1/; diff --git a/testsuites/libtests/malloc02/init.c b/testsuites/libtests/malloc02/init.c index 6db32478e7..bce3c9b5a1 100644 --- a/testsuites/libtests/malloc02/init.c +++ b/testsuites/libtests/malloc02/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/libtests/malloc02/malloc02.doc b/testsuites/libtests/malloc02/malloc02.doc index 2c44a2b2eb..6296ff2c73 100644 --- a/testsuites/libtests/malloc02/malloc02.doc +++ b/testsuites/libtests/malloc02/malloc02.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. diff --git a/testsuites/libtests/malloc03/init.c b/testsuites/libtests/malloc03/init.c index 89c147b1b6..8ada7ba4b3 100644 --- a/testsuites/libtests/malloc03/init.c +++ b/testsuites/libtests/malloc03/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/libtests/malloc03/malloc03.doc b/testsuites/libtests/malloc03/malloc03.doc index 2ad50c7e52..83c7dd1453 100644 --- a/testsuites/libtests/malloc03/malloc03.doc +++ b/testsuites/libtests/malloc03/malloc03.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. diff --git a/testsuites/libtests/malloc04/init.c b/testsuites/libtests/malloc04/init.c index 51d318850b..a9894d59fd 100644 --- a/testsuites/libtests/malloc04/init.c +++ b/testsuites/libtests/malloc04/init.c @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * COPYRIGHT (c) 1989-2011. * 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 @@ -78,16 +97,23 @@ rtems_task Init( ) { Heap_Control *real_heap; - Memory_Area area; - Memory_Information mem = { - .count = 1, - .areas = &area - }; + const Memory_Information *mem; + Memory_Area *area; + size_t i; void *p; TEST_BEGIN(); + mem = _Memory_Get(); + + for ( i = 0; i < _Memory_Get_count( mem ); ++i ) { + area = _Memory_Get_area( mem, i ); + _Memory_Initialize( area, NULL, NULL ); + } + + area = _Memory_Get_area( mem, 0 ); + /* Safe information on real heap */ real_heap = malloc_get_heap_pointer(); malloc_set_heap_pointer( &TempHeap ); @@ -98,8 +124,8 @@ rtems_task Init( sbrk_count = 0; offset = 256; - _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); - RTEMS_Malloc_Initialize( &mem, NULL ); + _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset ); + _Malloc_Initialize(); errno = 0; p = malloc( 256 ); @@ -113,8 +139,8 @@ rtems_task Init( sbrk_count = 0; offset = 256; - _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); - RTEMS_Malloc_Initialize( &mem, NULL ); + _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset ); + _Malloc_Initialize(); p = malloc(1); rtems_test_assert( p != NULL ); @@ -128,8 +154,8 @@ rtems_task Init( sbrk_count = 0; offset = 256; - _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); - RTEMS_Malloc_Initialize( &mem, NULL ); + _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset ); + _Malloc_Initialize(); errno = 0; p = malloc( sizeof( Malloc_Heap ) ); @@ -141,8 +167,8 @@ rtems_task Init( sbrk_count = 0; offset = 256; - _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); - RTEMS_Malloc_Initialize( &mem, NULL ); + _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset ); + _Malloc_Initialize(); p = malloc( 128 ); rtems_test_assert( p != NULL ); @@ -156,8 +182,8 @@ rtems_task Init( sbrk_count = -1; offset = 256; - _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); - RTEMS_Malloc_Initialize( &mem, NULL ); + _Memory_Initialize_by_size( area, &Malloc_Heap[ 0 ], offset ); + _Malloc_Initialize(); errno = 0; p = malloc( 256 ); diff --git a/testsuites/libtests/malloc04/malloc04.doc b/testsuites/libtests/malloc04/malloc04.doc index 6199e85cc3..9936e505d6 100644 --- a/testsuites/libtests/malloc04/malloc04.doc +++ b/testsuites/libtests/malloc04/malloc04.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. diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c index 1d91385683..d72f49112e 100644 --- a/testsuites/libtests/malloctest/init.c +++ b/testsuites/libtests/malloctest/init.c @@ -1,12 +1,31 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * COPYRIGHT (c) 1989-2011, 2014. * On-Line Applications Research Corporation (OAR). * - * Copyright (c) 2009, 2016 embedded brains GmbH. + * Copyright (C) 2009, 2016 embedded brains GmbH & Co. KG + * + * 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. * - * 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. + * 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 @@ -41,8 +60,15 @@ static void test_realloc(void) for (i=2 ; i<2048 ; i++) { p2 = realloc(p1, i); if (p2 != p1) +/* + * This was added to address the following warning. + * warning: pointer 'p1' may be used after 'realloc' + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuse-after-free" printf( "realloc - failed grow in place: " "%p != realloc(%p,%zu)\n", p1, p2, i); +#pragma GCC diagnostic pop p1 = p2; } free(p1); @@ -52,8 +78,15 @@ static void test_realloc(void) for (i=2047 ; i>=1; i--) { p2 = realloc(p1, i); if (p2 != p1) - printf( "realloc - failed shrink in place: " +/* + * This was added to address the following warning. + * warning: pointer 'p1' may be used after 'realloc' + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuse-after-free" + printf( "realloc - failed shrink in place: " "%p != realloc(%p,%zu)\n", p1, p2, i); +#pragma GCC diagnostic pop p1 = p2; } free(p1); @@ -65,8 +98,15 @@ static void test_realloc(void) p2 = malloc(32); p3 = realloc(p1, 64); if (p3 == p1 || p3 == NULL) - printf( +/* + * This was added to address the following warning. + * warning: pointer may be used after 'realloc' + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuse-after-free" + printf( "realloc - failed non-in place: realloc(%p,%d) = %p\n", p1, 64, p3); +#pragma GCC diagnostic pop free(p3); free(p2); @@ -103,7 +143,14 @@ static void test_realloc(void) /* * Realloc with a bad pointer to force a point */ - p4 = realloc( test_realloc, 32 ); +/* + * This was added to address the following warning. + * warning: 'realloc' called on unallocated object + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wfree-nonheap-object" + p4 = realloc( test_realloc, 32 ); +#pragma GCC diagnostic pop p4 = _realloc_r( NULL, NULL, 1 ); } @@ -122,9 +169,13 @@ static void test_heap_default_init(void) static void test_free( void *addr ) { + uint32_t failed_allocs; + rtems_test_assert( _Heap_Free( &TestHeap, addr ) ); + failed_allocs = TestHeap.stats.failed_allocs; _Heap_Protection_free_all_delayed_blocks( &TestHeap ); + rtems_test_assert( failed_allocs == TestHeap.stats.failed_allocs ); } static void test_heap_cases_1(void) @@ -1163,6 +1214,7 @@ static void test_rtems_malloc(void) p = rtems_malloc(1); rtems_test_assert(p != NULL); + RTEMS_OBFUSCATE_VARIABLE(p); free(p); } @@ -1190,10 +1242,20 @@ static void test_rtems_calloc(void) rtems_test_assert(p == NULL); rtems_test_assert(errno == 0); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Walloc-size-larger-than=N" + errno = 0; + p = rtems_calloc(SIZE_MAX, SIZE_MAX); + rtems_test_assert(p == NULL); + rtems_test_assert(errno == 0); +#pragma GCC diagnostic pop + i = rtems_calloc(1, sizeof(*i)); rtems_test_assert(i != NULL); rtems_test_assert(*i == 0); + + RTEMS_OBFUSCATE_VARIABLE(p); free(i); } @@ -1293,6 +1355,65 @@ static void test_greedy_allocate(void) rtems_test_assert( p == NULL ); } +static void test_alloc_zero_size(void) +{ + size_t size; + void *p; + int eno; + + size = 0; + errno = -1; + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = malloc( size ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = calloc( size, 1 ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = rtems_malloc( size ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = rtems_calloc( 1, size ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = (void *)(uintptr_t) 1; + eno = posix_memalign( &p, 32, size ); + rtems_test_assert( eno == 0 ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = (void *)(uintptr_t) 1; + eno = rtems_memalign( &p, 32, size ); + rtems_test_assert( eno == 0 ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = aligned_alloc( 32, size ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = realloc( NULL, size ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); + + RTEMS_OBFUSCATE_VARIABLE( size ); + p = reallocarray( NULL, 1, size ); + rtems_test_assert( p == NULL ); + rtems_test_assert( errno == -1 ); +} + rtems_task Init( rtems_task_argument argument ) @@ -1313,22 +1434,11 @@ rtems_task Init( #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Walloc-size-larger-than=N" p1 = calloc( 1, SIZE_MAX ); -#pragma GCC diagnostic pop - if (p1) { - printf("ERROR on attempt to calloc SIZE_MAX block expected failure."); - free( p1 ); - } - - /* - * Verify error case where malloc of size 0. - */ - p1 = malloc( 0 ); - if (p1) { - printf("ERROR on attempt to malloc size 0 block expected failure."); - free( p1 ); - } - + rtems_test_assert( p1 == NULL ); + p1 = calloc( SIZE_MAX, SIZE_MAX ); + rtems_test_assert( p1 == NULL ); +#pragma GCC diagnostic pop test_heap_initialize(); test_heap_block_allocate(); @@ -1348,6 +1458,7 @@ rtems_task Init( test_rtems_malloc(); test_rtems_calloc(); test_greedy_allocate(); + test_alloc_zero_size(); test_posix_memalign(); @@ -1445,8 +1556,15 @@ static void test_early_malloc( void ) free( q ); +/* + * This was added to address the following warning. + * warning: pointer 'q' used after 'free' + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuse-after-free" r = realloc( q, 128 ); rtems_test_assert( r == q ); +#pragma GCC diagnostic pop s = malloc( 1 ); rtems_test_assert( s != NULL ); diff --git a/testsuites/libtests/malloctest/system.h b/testsuites/libtests/malloctest/system.h index 53a13fc1d6..adf3f4a678 100644 --- a/testsuites/libtests/malloctest/system.h +++ b/testsuites/libtests/malloctest/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <tmacros.h> diff --git a/testsuites/libtests/malloctest/task1.c b/testsuites/libtests/malloctest/task1.c index 753a74e77a..4feb338b87 100644 --- a/testsuites/libtests/malloctest/task1.c +++ b/testsuites/libtests/malloctest/task1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* task1.c * * This set of three tasks do some simple task switching for about @@ -6,9 +8,26 @@ * 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 @@ -34,7 +53,7 @@ rtems_task Task_1_through_5( unsigned char *mem_ptr; int mem_amt; - status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); + status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid ); directive_failed( status, "rtems_task_ident" ); while (TRUE) diff --git a/testsuites/libtests/math/init.c b/testsuites/libtests/math/init.c index a5f6802b00..3fedb5546a 100644 --- a/testsuites/libtests/math/init.c +++ b/testsuites/libtests/math/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Init * * This routine is the initialization task for this test program. @@ -13,9 +15,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/mathf/init.c b/testsuites/libtests/mathf/init.c index 143ac63f1a..d63509dbc3 100644 --- a/testsuites/libtests/mathf/init.c +++ b/testsuites/libtests/mathf/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Init * * This routine is the initialization task for this test program. @@ -13,9 +15,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/mathl/init.c b/testsuites/libtests/mathl/init.c index fb390bb2c2..2605fdb8e3 100644 --- a/testsuites/libtests/mathl/init.c +++ b/testsuites/libtests/mathl/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Init * * This routine is the initialization task for this test program. @@ -13,9 +15,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/md501/init.c b/testsuites/libtests/md501/init.c index da14ea4d7a..e388f082b2 100644 --- a/testsuites/libtests/md501/init.c +++ b/testsuites/libtests/md501/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/mghttpd01/init.c b/testsuites/libtests/mghttpd01/init.c deleted file mode 100644 index 93d42e174a..0000000000 --- a/testsuites/libtests/mghttpd01/init.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <rtems.h> - -#include <tmacros.h> - -#include <rtems/rtems_bsdnet.h> - -#include <stdio.h> -#include <string.h> -#include <mghttpd/mongoose.h> - -#include <rtems/imfs.h> -#include <rtems/error.h> -#include "mghttpd01-tar.h" - -#include "test-http-client.h" - -const char rtems_test_name[] = "MGHTTPD 1"; - -#define TARFILE_START mghttpd01_tar -#define TARFILE_SIZE mghttpd01_tar_size - -#define CBACKTEST_URI "/callbacktest.txt" -#define CBACKTEST_TXT "HTTP/1.1 200 OK\r\n" \ - "Content-Type: text/plain\r\n" \ - "Content-Length: 47\r\n" \ - "\r\n" \ - "This is a message from the callback function.\r\n" - -#define WSTEST_REQ "Test request" -#define WSTEST_RESP "This is a message from the WebSocket callback function." - -#define INDEX_HTML "HTTP/1.1 200 OK\r\n" \ - "Date: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n" \ - "Last-Modified: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n" \ - "Etag: \"21dae500.162\"\r\n" \ - "Content-Type: text/html\r\n" \ - "Content-Length: 162\r\n" \ - "Connection: close\r\n" \ - "Accept-Ranges: bytes\r\n" \ - "\r\n" \ - "<html>\r\n" \ - "<head>\r\n" \ - "<title>Second Instance</title>\r\n" \ - "</head>\r\n" \ - "\r\n" \ - "<body>\r\n" \ - "<h1>Second Instance</h1>\r\n" \ - "A test page for the Mongoose web server on RTEMS.\r\n" \ - "</body>\r\n" \ - "</html>\r\n" - -#define DATE_TAG "Date: " -#define LASTMOD_TAG "Last-Modified: " -#define TIMESTAMP_SIZE (sizeof("Fri, 01 Jan 1988 00:00:26 GMT") - 1) - -#define BUFFERSIZE 1024 - -static void test_tarfs_load(void) -{ - rtems_status_code sc; - - printf("Loading tarfs image ... "); - sc = rtems_tarfs_load("/",(void *)TARFILE_START, TARFILE_SIZE); - if (sc != RTEMS_SUCCESSFUL) { - printf ("error: untar failed: %s\n", rtems_status_text (sc)); - rtems_test_exit(1); - } - printf ("successful\n"); -} - -static int callback(struct mg_connection *conn) -{ - int cbacktest = strncmp(mg_get_request_info(conn)->uri, CBACKTEST_URI, sizeof(CBACKTEST_URI)); - if (cbacktest == 0) - { - mg_write(conn, CBACKTEST_TXT, sizeof(CBACKTEST_TXT)); - - /* Mark as processed */ - return 1; - } - - return 0; -} - -static int callback_websocket(struct mg_connection *connection, - int bits, - char *data, - size_t data_len) -{ - if (data_len == strlen(WSTEST_REQ) && strncmp(data, WSTEST_REQ, data_len) == 0) - { - mg_websocket_write(connection, WEBSOCKET_OPCODE_TEXT, WSTEST_RESP, strlen(WSTEST_RESP)); - - /* Don't close the WebSocket */ - return 1; - } - - return 0; -} - -static void test_mg_index_html(void) -{ - httpc_context httpc_ctx; - char *buffer = malloc(BUFFERSIZE); - char *workpos = buffer; - bool brv = false; - int rv = 0; - - rtems_test_assert(buffer != NULL); - - puts("=== Get the index.html from second Mongoose instance:"); - - httpc_init_context(&httpc_ctx); - brv = httpc_open_connection(&httpc_ctx, "127.0.0.1", 8080); - rtems_test_assert(brv); - brv = httpc_send_request(&httpc_ctx, "GET /index.html", buffer, BUFFERSIZE); - rtems_test_assert(brv); - brv = httpc_close_connection(&httpc_ctx); - rtems_test_assert(brv); - puts(buffer); - - /* remove timestamps from html-header */ - workpos = strstr(buffer, DATE_TAG); - rtems_test_assert(workpos != NULL); - workpos += sizeof(DATE_TAG) - 1; - memset(workpos, 'x', TIMESTAMP_SIZE); - - workpos = strstr(buffer, LASTMOD_TAG); - rtems_test_assert(workpos != NULL); - workpos += sizeof(LASTMOD_TAG) - 1; - memset(workpos, 'x', TIMESTAMP_SIZE); - - rv = strcmp(buffer, INDEX_HTML); - rtems_test_assert(rv == 0); - - puts("=== OK"); - - free(buffer); -} - -static void test_mg_callback(void) -{ - httpc_context httpc_ctx; - char *buffer = malloc(BUFFERSIZE); - bool brv = false; - int rv = 0; - - rtems_test_assert(buffer != NULL); - - puts("=== Get a page generated from a callback function from" \ - " first Mongoose instance:"); - - httpc_init_context(&httpc_ctx); - brv = httpc_open_connection(&httpc_ctx, "127.0.0.1", 80); - rtems_test_assert(brv); - brv = httpc_send_request(&httpc_ctx, "GET " CBACKTEST_URI, buffer, BUFFERSIZE); - rtems_test_assert(brv); - brv = httpc_close_connection(&httpc_ctx); - rtems_test_assert(brv); - puts(buffer); - rv = strcmp(buffer, CBACKTEST_TXT); - rtems_test_assert(rv == 0); - - puts("=== OK"); - - free(buffer); -} - -static void test_mg_websocket(void) -{ - httpc_context httpc_ctx; - char *buffer = malloc(BUFFERSIZE); - bool brv = false; - int rv = 0; - - rtems_test_assert(buffer != NULL); - - puts("=== Get a WebSocket response generated from a callback function" \ - " from first Mongoose instance:"); - - httpc_init_context(&httpc_ctx); - brv = httpc_open_connection(&httpc_ctx, "127.0.0.1", 80); - rtems_test_assert(brv); - brv = httpc_ws_open_connection(&httpc_ctx); - rtems_test_assert(brv); - brv = httpc_ws_send_request(&httpc_ctx, WSTEST_REQ, buffer, BUFFERSIZE); - rtems_test_assert(brv); - brv = httpc_close_connection(&httpc_ctx); - rtems_test_assert(brv); - puts(buffer); - rv = strcmp(buffer, WSTEST_RESP); - rtems_test_assert(rv == 0); - - puts("=== OK"); - - free(buffer); -} - -static void test_mongoose(void) -{ - const struct mg_callbacks callbacks = { - .begin_request = callback, - .websocket_data = callback_websocket - }; - const char *options[] = { - "listening_ports", "80", - "document_root", "/www", - "num_threads", "1", - "thread_stack_size", "16384", - "thread_priority", "250", - "thread_policy", "o", - NULL}; - const struct mg_callbacks callbacks2 = { - NULL - }; - const char *options2[] = { - "listening_ports", "8080", - "document_root", "/www2", - "num_threads", "1", - "thread_stack_size", "16384", - NULL}; - - struct mg_context *mg1 = mg_start(&callbacks, NULL, options); - struct mg_context *mg2 = mg_start(&callbacks2, NULL, options2); - - test_mg_index_html(); - test_mg_callback(); - test_mg_websocket(); - - mg_stop(mg1); - mg_stop(mg2); -} - -static void Init(rtems_task_argument arg) -{ - int rv = 0; - - TEST_BEGIN(); - - rv = rtems_bsdnet_initialize_network(); - rtems_test_assert(rv == 0); - - test_tarfs_load(); - - test_mongoose(); - - TEST_END(); - - rtems_test_exit(0); -} - -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER - -#define CONFIGURE_FILESYSTEM_IMFS - -#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 16 - -#define CONFIGURE_UNLIMITED_OBJECTS - -#define CONFIGURE_UNIFIED_WORK_AREAS - -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT_TASK_STACK_SIZE (16 * 1024) -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT - -#define CONFIGURE_INIT - -#include <rtems/confdefs.h> diff --git a/testsuites/libtests/mghttpd01/mghttpd01.scn b/testsuites/libtests/mghttpd01/mghttpd01.scn deleted file mode 100644 index d3c061f0ae..0000000000 --- a/testsuites/libtests/mghttpd01/mghttpd01.scn +++ /dev/null @@ -1,33 +0,0 @@ -*** TEST MGHTTPD 01 *** -Loading tarfs image ... successful -=== Get the index.html from second Mongoose instance: -HTTP/1.1 200 OK -Date: Fri, 01 Jan 1988 00:00:01 GMT -Last-Modified: Fri, 01 Jan 1988 00:00:01 GMT -Etag: "21dae501.a2" -Content-Type: text/html -Content-Length: 162 -Connection: close -Accept-Ranges: bytes - -<html> -<head> -<title>Second Instance</title> -</head> - -<body> -<h1>Second Instance</h1> -A test page for the Mongoose web server on RTEMS. -</body> -</html> - -=== OK -=== Get a page generated from a callback function from first Mongoose instance: -HTTP/1.1 200 OK -Content-Type: text/plain -Content-Length: 47 - -This is a message from the callback function. - -=== OK -*** END OF TEST MGHTTPD 01 *** diff --git a/testsuites/libtests/mghttpd01/mghttpd01.tar b/testsuites/libtests/mghttpd01/mghttpd01.tar Binary files differdeleted file mode 100644 index 67132d5122..0000000000 --- a/testsuites/libtests/mghttpd01/mghttpd01.tar +++ /dev/null diff --git a/testsuites/libtests/mghttpd01/test-http-client.c b/testsuites/libtests/mghttpd01/test-http-client.c deleted file mode 100644 index 806283b2d2..0000000000 --- a/testsuites/libtests/mghttpd01/test-http-client.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * 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. - */ - - -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <netdb.h> -#include <limits.h> -#include <unistd.h> -#include <stdint.h> -#include <string.h> - -#include <tmacros.h> - -#include "test-http-client.h" - -#define HTTPC_WS_CONN_REQ "GET / HTTP/1.1\r\n" \ - "Host: localhost\r\n" \ - "Upgrade: websocket\r\n" \ - "Connection: Upgrade\r\n" \ - "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n" \ - "Sec-WebSocket-Version: 13\r\n" \ - "\r\n" -#define HTTPC_WS_CONN_RESP "HTTP/1.1 101 Switching Protocols\r\n" \ - "Upgrade: websocket\r\n" \ - "Connection: Upgrade\r\n" \ - "Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n" \ - "\r\n" - -static ssize_t httpc_read_full( - const httpc_context *ctx, - void *response, - size_t responsesize -); - -void httpc_init_context( - httpc_context *ctx -) -{ - ctx->socket = -1; - ctx->fd = NULL; -} - -bool httpc_open_connection( - httpc_context *ctx, - const char *targethost, - int targetport -) -{ - struct sockaddr_in addr; - - struct hostent *server; - - ctx->socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if(ctx->socket < 0) { return false; } - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(targetport); - - server = gethostbyname(targethost); - if(server == NULL) { return false; } - memcpy(&addr.sin_addr.s_addr, server->h_addr, (size_t) server->h_length); - - if(connect(ctx->socket, (struct sockaddr *)&addr, sizeof(addr)) != 0) - { - return false; - } - - ctx->fd = fdopen(ctx->socket,"rw"); - if(ctx->fd == NULL) { return false; } - - return true; -} - -bool httpc_close_connection( - httpc_context *ctx -) -{ - if(close(ctx->socket) != 0) - { - return false; - } - - return true; -} - -bool httpc_send_request( - const httpc_context *ctx, - const char *request, - char *response, - int responsesize -) -{ - rtems_test_assert(ctx != NULL); - rtems_test_assert(ctx->socket >= 0); - rtems_test_assert(request != NULL); - rtems_test_assert(response != NULL); - rtems_test_assert(responsesize > 1); - - static const char * const lineend = " HTTP/1.1\r\n\r\n"; - - write(ctx->socket, request, strlen(request)); - write(ctx->socket, lineend, strlen(lineend)); - - ssize_t size; - if((size = httpc_read_full(ctx, response, responsesize - 1)) == -1) - { - return false; - } - *(response + size) = '\0'; - - return true; -} - -bool httpc_ws_open_connection( - const httpc_context *ctx -) -{ - rtems_test_assert(ctx != NULL); - rtems_test_assert(ctx->socket >= 0); - - write(ctx->socket, HTTPC_WS_CONN_REQ, strlen(HTTPC_WS_CONN_REQ)); - - char response[strlen(HTTPC_WS_CONN_RESP)]; - if(httpc_read_full(ctx, response, sizeof(response)) != sizeof(response)) - { - return false; - } - if(strncmp(response, HTTPC_WS_CONN_RESP, sizeof(response)) != 0) - { - return false; - } - - return true; -} - -bool httpc_ws_send_request( - const httpc_context *ctx, - const char *request, - char *response, - int responsesize -) -{ - rtems_test_assert(ctx != NULL); - rtems_test_assert(ctx->socket >= 0); - rtems_test_assert(request != NULL); - rtems_test_assert(response != NULL); - rtems_test_assert(responsesize > 0); - - static const uint16_t ws_header_fin = 1U << 15; - static const uint16_t ws_header_text = 1U << 8; - static const uint16_t ws_header_size = 0x7FU; - - /* - * We don't support sending WebSocket messages which require multiple - * chunks - */ - if(strlen(request) > ws_header_size) { return false; } - - uint16_t header = htons(ws_header_fin | ws_header_text | strlen(request)); - - write(ctx->socket, &header, sizeof(header)); - write(ctx->socket, request, strlen(request)); - - if (httpc_read_full(ctx, &header, sizeof(header)) != sizeof(header)) - { - return false; - } - header = ntohs(header); - if (!(header & ws_header_fin)) { return false; } - if (!(header & ws_header_text)) { return false; } - if (responsesize < (header & ws_header_size) + 1) { return false; } - - responsesize = header & ws_header_size; - if (httpc_read_full(ctx, response, responsesize) != responsesize) - { - return false; - } - *(response + responsesize) = '\0'; - - return true; -} - - -static ssize_t httpc_read_full( - const httpc_context *ctx, - void *response, - size_t responsesize -) -{ - rtems_test_assert(ctx != NULL); - rtems_test_assert(ctx->socket >= 0); - rtems_test_assert(response != NULL); - rtems_test_assert(responsesize > 0); - - if (responsesize > SSIZE_MAX) { return -1; } - - unsigned char *pos = response; - - while(pos < (unsigned char *)response + responsesize) - { - ssize_t size = - read(ctx->socket, pos, (unsigned char *)response + responsesize - pos); - if (size == -1) { return -1; } - if (size == 0) { break; } - pos += size; - } - - return (pos - (unsigned char *)response); -} diff --git a/testsuites/libtests/mghttpd01/test-http-client.h b/testsuites/libtests/mghttpd01/test-http-client.h deleted file mode 100644 index 811c790110..0000000000 --- a/testsuites/libtests/mghttpd01/test-http-client.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * 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. - */ - -#ifndef TEST_WEB_CLIENT_H -#define TEST_WEB_CLIENT_H - -#include <stdint.h> -#include <stdbool.h> -#include <stdio.h> - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef struct -{ - int socket; - FILE *fd; -} -httpc_context; - -void httpc_init_context( - httpc_context *ctx -); - -bool httpc_open_connection( - httpc_context *ctx, - const char *targethost, - int targetport -); - -bool httpc_close_connection( - httpc_context *ctx -); - -bool httpc_send_request( - const httpc_context *ctx, - const char *request, - char *response, - int responsesize -); - -bool httpc_ws_open_connection( - const httpc_context *ctx -); - -bool httpc_ws_send_request( - const httpc_context *ctx, - const char *request, - char *response, - int responsesize -); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* TEST_WEB_CLIENT_H */ diff --git a/testsuites/libtests/monitor/init.c b/testsuites/libtests/monitor/init.c index 6fe78a144f..fcdea9d144 100644 --- a/testsuites/libtests/monitor/init.c +++ b/testsuites/libtests/monitor/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * This is a simple test whose only purpose is to start the Monitor * task. The Monitor task can be used to obtain information about @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/monitor/monitor.doc b/testsuites/libtests/monitor/monitor.doc index 3a698fa48f..c3cd6e3034 100644 --- a/testsuites/libtests/monitor/monitor.doc +++ b/testsuites/libtests/monitor/monitor.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 2014. # On-Line Applications Research Corporation (OAR). # Cynthia Rempel <cynthia@rtems.org> -# 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. diff --git a/testsuites/libtests/monitor/system.h b/testsuites/libtests/monitor/system.h index 7e23bd2d40..dc9224731a 100644 --- a/testsuites/libtests/monitor/system.h +++ b/testsuites/libtests/monitor/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <tmacros.h> diff --git a/testsuites/libtests/monitor02/init.c b/testsuites/libtests/monitor02/init.c index 22818cc441..d5e5d930a1 100644 --- a/testsuites/libtests/monitor02/init.c +++ b/testsuites/libtests/monitor02/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * This is a simple test whose only purpose is to start the Monitor * task. The Monitor task can be used to obtain information about @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/monitor02/monitor02.doc b/testsuites/libtests/monitor02/monitor02.doc index df696b48a5..440cdfd5b1 100644 --- a/testsuites/libtests/monitor02/monitor02.doc +++ b/testsuites/libtests/monitor02/monitor02.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 2014. # On-Line Applications Research Corporation (OAR). # Cynthia Rempel <cynthia@rtems.org> -# 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. diff --git a/testsuites/libtests/monitor02/system.h b/testsuites/libtests/monitor02/system.h index 3d05473c57..f16167eb22 100644 --- a/testsuites/libtests/monitor02/system.h +++ b/testsuites/libtests/monitor02/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <tmacros.h> diff --git a/testsuites/libtests/mouse01/init.c b/testsuites/libtests/mouse01/init.c index 5f9ed18161..a26fa6e2e3 100644 --- a/testsuites/libtests/mouse01/init.c +++ b/testsuites/libtests/mouse01/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/libtests/mouse01/mouse01.doc b/testsuites/libtests/mouse01/mouse01.doc index a38e8d24c4..ebbd9e085f 100644 --- a/testsuites/libtests/mouse01/mouse01.doc +++ b/testsuites/libtests/mouse01/mouse01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 2011. # 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. diff --git a/testsuites/libtests/mouse01/msmouse.c b/testsuites/libtests/mouse01/msmouse.c index 838cbcf084..82701c0956 100644 --- a/testsuites/libtests/mouse01/msmouse.c +++ b/testsuites/libtests/mouse01/msmouse.c @@ -1,10 +1,29 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * COPYRIGHT (c) 1989-2011. * 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/libtests/mouse01/serial_mouse_config.c b/testsuites/libtests/mouse01/serial_mouse_config.c index 798cbf3a3b..7f74edb95e 100644 --- a/testsuites/libtests/mouse01/serial_mouse_config.c +++ b/testsuites/libtests/mouse01/serial_mouse_config.c @@ -1,3 +1,38 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup libtests + * + * @brief This is serial_mouse_config for mouse01. + */ + +/* + * Copyright (C) 1989-2011 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. + */ + /* * * MODULE DESCRIPTION: diff --git a/testsuites/libtests/networking01/init.c b/testsuites/libtests/networking01/init.c deleted file mode 100644 index 0d13ae7a75..0000000000 --- a/testsuites/libtests/networking01/init.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2016 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/socket.h> -#include <netdb.h> -#include <string.h> -#include <netinet/in.h> - -#include <rtems.h> -#include <tmacros.h> - -const char rtems_test_name[] = "NETWORKING 1"; - -/* forward declarations to avoid warnings */ -static rtems_task Init(rtems_task_argument argument); - -static void fill_sa(struct sockaddr *sa, sa_family_t family) -{ - memset(sa, 0, sizeof(*sa)); - sa->sa_len = sizeof(*sa); - sa->sa_family = family; -} - -static void fill_sa_in(struct sockaddr_in *sa_in, - in_addr_t addr, in_port_t port) -{ - fill_sa((struct sockaddr *)sa_in, AF_INET); - sa_in->sin_port = htons(port); - sa_in->sin_addr.s_addr = htonl(addr); -} - -static void test_getnameinfo( - const struct sockaddr *sa, - int flags, - bool ask_node, - bool ask_service, - int expected_returnvalue, - const char *expected_node, - const char *expected_service -) -{ - char node[] = "255.255.255.255"; - char service[] = "65535"; - socklen_t salen = sa->sa_len; - int rv; - - char *node_p = node; - char *service_p = service; - size_t node_l = sizeof(node); - size_t service_l = sizeof(service); - - if(ask_node == false) { - node_p = NULL; - node_l = 0; - } - - if(ask_service == false) { - service_p = NULL; - service_l = 0; - } - - rv = getnameinfo(sa, salen, node_p, node_l, service_p, service_l, flags); - rtems_test_assert(rv == expected_returnvalue); - - if(expected_node != NULL) { - rtems_test_assert(strcmp(expected_node, node) == 0); - } - - if(expected_service != NULL) { - rtems_test_assert(strcmp(expected_service, service) == 0); - } -} - -static void test(void) -{ - struct sockaddr sa; - struct sockaddr_in sa_in; - struct sockaddr *sa_in_p = (struct sockaddr *) &sa_in; - - const in_addr_t ip1_num = 0x7F000001u; - const char ip1_string[] = "127.0.0.1"; - - const in_addr_t ip2_num = 0xC0A86464u; - const char ip2_string[] = "192.168.100.100"; - - const in_port_t port1_num = 7u; - const char port1_string[] = "7"; - - const in_port_t port2_num = 65534u; - const char port2_string[] = "65534"; - - - puts("Try AF_INET6"); - fill_sa(&sa, AF_INET6); - test_getnameinfo(&sa, 0, true, true, EAI_FAMILY, NULL, NULL); - - puts("force node name"); - fill_sa_in(&sa_in, ip1_num, port1_num); - test_getnameinfo(sa_in_p, NI_NAMEREQD, true, true, EAI_NONAME, NULL, NULL); - - puts("force service name"); - fill_sa_in(&sa_in, ip1_num, port1_num); - test_getnameinfo(sa_in_p, NI_NAMEREQD, true, true, EAI_NONAME, NULL, NULL); - - puts("get node only"); - fill_sa_in(&sa_in, ip1_num, port1_num); - test_getnameinfo(sa_in_p, 0, true, false, 0, ip1_string, NULL); - - puts("get service only"); - fill_sa_in(&sa_in, ip1_num, port1_num); - test_getnameinfo(sa_in_p, 0, false, true, 0, NULL, port1_string); - - puts("get node and service"); - fill_sa_in(&sa_in, ip1_num, port1_num); - test_getnameinfo(sa_in_p, 0, true, true, 0, ip1_string, port1_string); - - puts("get node and service with maximum number of characters for IP"); - fill_sa_in(&sa_in, ip2_num, port2_num); - test_getnameinfo(sa_in_p, 0, true, true, 0, ip2_string, port2_string); -} - -static rtems_task Init(rtems_task_argument argument) -{ - TEST_BEGIN(); - test(); - TEST_END(); - - rtems_test_exit(0); -} - -#define CONFIGURE_INIT - -#define CONFIGURE_MICROSECONDS_PER_TICK 10000 - -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS (1) - -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT - -#include <rtems/confdefs.h> diff --git a/testsuites/libtests/networking01/networking01.doc b/testsuites/libtests/networking01/networking01.doc deleted file mode 100644 index 949a32cbcb..0000000000 --- a/testsuites/libtests/networking01/networking01.doc +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (c) 2016 embedded brains GmbH. All rights reserved. -# -# embedded brains GmbH -# Dornierstr. 4 -# 82178 Puchheim -# Germany -# <rtems@embedded-brains.de> -# -# 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. - -This file describes the directives and concepts tested by this test set. - -test set name: networking - -directives: - -+ getnameinfo() - -concepts: - -+ Try to get some valid and invalid name infos. - -NOTE: This test works without a network connection. diff --git a/testsuites/libtests/networking01/networking01.scn b/testsuites/libtests/networking01/networking01.scn deleted file mode 100644 index 75e8457a0f..0000000000 --- a/testsuites/libtests/networking01/networking01.scn +++ /dev/null @@ -1,9 +0,0 @@ -*** BEGIN OF TEST LIBNETWORKING 1 *** -Try AF_INET6 -force node name -force service name -get node only -get service only -get node and service -get node and service with maximum number of characters for IP -*** END OF TEST LIBNETWORKING 1 *** diff --git a/testsuites/libtests/newlib01/init.c b/testsuites/libtests/newlib01/init.c index 383abf41f6..d3ccbddba1 100644 --- a/testsuites/libtests/newlib01/init.c +++ b/testsuites/libtests/newlib01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (C) 2014, 2022 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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 @@ -17,19 +30,28 @@ #endif #include <stdio.h> +#include <errno.h> #include <sys/reent.h> +#include <sys/stat.h> #include <rtems.h> #include <rtems/console.h> #include <rtems/imfs.h> #include <rtems/libcsupport.h> +#include <rtems/sysinit.h> #include "tmacros.h" +#ifndef _REENT_CLEANUP +#define _REENT_CLEANUP(ptr) ((ptr)->__cleanup) +#endif + const char rtems_test_name[] = "NEWLIB 1"; -static const char file_path[] = "/file"; +static const char stdio_file_path[] = "/stdio-file"; + +static const char non_stdio_file_path[] = "/non-stdio-file"; typedef enum { INIT, @@ -42,6 +64,8 @@ typedef struct { rtems_id main_task_id; rtems_id worker_task_id; test_state current; + FILE *non_stdio_file; + int non_stdio_fd; } test_context; static test_context test_instance; @@ -62,25 +86,71 @@ static void wait(void) rtems_test_assert(sc == RTEMS_SUCCESSFUL); } -static void worker_task(rtems_task_argument arg) +/* + * Check that rand() is properly initialized and returns the expected sequence + * for default seed values. A call to rand() without any previous call to + * srand() generates the same sequence as when srand() is first called with a + * seed value of 1. + */ +static void test_rand(void) +{ + int rv; + + rv = rand(); + rtems_test_assert(rv == 1481765933); + rv = rand(); + rtems_test_assert(rv == 1085377743); + rv = rand(); + rtems_test_assert(rv == 1270216262); + + srand(1); + rv = rand(); + rtems_test_assert(rv == 1481765933); + rv = rand(); + rtems_test_assert(rv == 1085377743); + rv = rand(); + rtems_test_assert(rv == 1270216262); +} + +/* + * Check that lrand48() is properly initialized and returns the expected + * sequence for default seed values. A call to lrand48() without any previous + * call to srand48() uses default constant initializer values set in the _seed + * member of struct _rand48. + */ +static void test_lrand48(void) +{ + long rv; + + rv = lrand48(); + rtems_test_assert(rv == 851401618); + rv = lrand48(); + rtems_test_assert(rv == 1804928587); + rv = lrand48(); + rtems_test_assert(rv == 758783491); +} + +static void stdio_file_worker(rtems_task_argument arg) { test_context *ctx = &test_instance; - struct _reent *reent = _REENT; FILE *output; char buf[1] = { 'x' }; size_t n; - rtems_test_assert(reent->__sdidinit == 0); + test_rand(); + test_lrand48(); - output = stdout = fopen(&file_path[0], "r+"); + rtems_test_assert(_REENT_CLEANUP(_REENT) == NULL); + + output = stdout = fopen(&stdio_file_path[0], "r+"); rtems_test_assert(stdout != NULL); /* * Check newlib's __sinit does not touch our assigned file pointer. */ - rtems_test_assert(reent->__sdidinit == 0); + rtems_test_assert(_REENT_CLEANUP(_REENT) == NULL); rtems_test_assert(fflush(stdout) == 0); - rtems_test_assert(reent->__sdidinit != 0); + rtems_test_assert(_REENT_CLEANUP(_REENT) != NULL); rtems_test_assert(stdout == output); n = fwrite(&buf[0], sizeof(buf), 1, stdout); @@ -93,6 +163,30 @@ static void worker_task(rtems_task_argument arg) rtems_test_assert(0); } +static void non_stdio_file_worker(rtems_task_argument arg) +{ + test_context *ctx = &test_instance; + FILE *fp; + char buf[1] = { 'y' }; + size_t n; + int fd; + + fp = ctx->non_stdio_file = fopen(&non_stdio_file_path[0], "w"); + rtems_test_assert(fp != NULL); + + /* Get file descriptor of new global file stream, store it in text context */ + fd = fileno(fp); + rtems_test_assert(fd != -1); + ctx->non_stdio_fd = fd; + + n = fwrite(&buf[0], sizeof(buf), 1, fp); + rtems_test_assert(n == 1); + + wake_up_main(ctx); + + rtems_test_assert(0); +} + static int handler_open( rtems_libio_t *iop, const char *path, @@ -253,31 +347,9 @@ static const IMFS_node_control node_control = IMFS_GENERIC_INITIALIZER( IMFS_node_destroy_default ); -static void test(void) +static void create_and_run_worker(test_context *ctx, rtems_task_entry entry) { - test_context *ctx = &test_instance; rtems_status_code sc; - int rv; - rtems_resource_snapshot snapshot; - FILE *file; - - ctx->main_task_id = rtems_task_self(); - - /* Fill dynamic file pool in Newlib _GLOBAL_REENT */ - file = fopen(CONSOLE_DEVICE_NAME, "r+"); - rtems_test_assert(file != NULL); - rv = fclose(file); - rtems_test_assert(rv == 0); - - rtems_resource_snapshot_take(&snapshot); - - rv = IMFS_make_generic_node( - &file_path[0], - S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, - &node_control, - NULL - ); - rtems_test_assert(rv == 0); sc = rtems_task_create( rtems_build_name('W', 'O', 'R', 'K'), @@ -289,38 +361,224 @@ static void test(void) ); rtems_test_assert(sc == RTEMS_SUCCESSFUL); - sc = rtems_task_start(ctx->worker_task_id, worker_task, 0); + sc = rtems_task_start(ctx->worker_task_id, entry, 0); rtems_test_assert(sc == RTEMS_SUCCESSFUL); wait(); sc = rtems_task_delete(ctx->worker_task_id); rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +/* + * Check that a FILE opened by a task and assigned to a stdio stream is closed + * during thread termination. Ensure that resources are returned to the system. + */ +static void test_stdio_file(test_context *ctx) +{ + int rv; + rtems_resource_snapshot snapshot; + + rtems_resource_snapshot_take(&snapshot); + + rv = IMFS_make_generic_node( + &stdio_file_path[0], + S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, + &node_control, + NULL + ); + rtems_test_assert(rv == 0); - rv = unlink(&file_path[0]); + create_and_run_worker(ctx, stdio_file_worker); + + rv = unlink(&stdio_file_path[0]); rtems_test_assert(rv == 0); rtems_test_assert(rtems_resource_snapshot_check(&snapshot)); } +/* + * Open a global FILE object from a task but do not assign it to a stdio + * stream. The FILE is not closed upon thread termination. + */ +static void test_non_stdio_file(test_context *ctx) +{ + create_and_run_worker(ctx, non_stdio_file_worker); +} + +/* + * This exit handler will be called last among the functions registered with + * atexit(). Check that stdio file descriptors are closed. The Newlib cleanup + * handler has not yet run, so the stdio FILE objects themselves are still + * open. + */ +static void check_after_libio_exit(void) +{ + test_context *ctx = &test_instance; + struct stat unused; + int rv; + + errno = 0; + rv = fstat(0, &unused); + rtems_test_assert(rv == -1); + rtems_test_assert(errno == EBADF); + + errno = 0; + rv = fstat(1, &unused); + rtems_test_assert(rv == -1); + rtems_test_assert(errno == EBADF); + + errno = 0; + rv = fstat(2, &unused); + rtems_test_assert(rv == -1); + rtems_test_assert(errno == EBADF); + + rtems_test_assert(stdin->_flags != 0); + rtems_test_assert(stdout->_flags != 0); + rtems_test_assert(stderr->_flags != 0); + + /* + * The non-stdio file and its file descriptor should be still open at this + * point. + */ + rv = fstat(ctx->non_stdio_fd, &unused); + rtems_test_assert(rv == 0); + rtems_test_assert(ctx->non_stdio_file->_flags != 0); +} + +static void register_exit_handler_before_libio_exit(void) +{ + int rv; + + rv = atexit(check_after_libio_exit); + rtems_test_assert(rv == 0); +} + +/* + * Register the exit handler before rtems_libio_exit() so that + * check_after_libio_exit() is called after rtems_libio_exit(). The exit() + * handlers are in a LIFO list. + */ +RTEMS_SYSINIT_ITEM(register_exit_handler_before_libio_exit, + RTEMS_SYSINIT_STD_FILE_DESCRIPTORS, RTEMS_SYSINIT_ORDER_FIRST); + +/* + * At this point, neither the functions registered with atexit() nor the Newlib + * cleanup procedures have been called. Therefore, stdio file descriptors + * should be open and stdio FILE object flags should be non-zero. + */ +static void test_exit_handling(test_context *ctx) +{ + struct stat unused; + int rv; + + rv = fstat(0, &unused); + rtems_test_assert(rv == 0); + + rv = fstat(1, &unused); + rtems_test_assert(rv == 0); + + rv = fstat(2, &unused); + rtems_test_assert(rv == 0); + + rtems_test_assert(stdin->_flags != 0); + rtems_test_assert(stdout->_flags != 0); + rtems_test_assert(stderr->_flags != 0); + + /* + * The file descriptor of the non-stdio file should still be open; the FILE + * object flags should still be non-zero. + */ + rv = fstat(ctx->non_stdio_fd, &unused); + rtems_test_assert(rv == 0); + rtems_test_assert(ctx->non_stdio_file->_flags != 0); + + /* Run exit handlers and Newlib cleanup procedures */ + exit(0); +} + static void Init(rtems_task_argument arg) { + test_context *ctx = &test_instance; + FILE *file; + int rv; + TEST_BEGIN(); + test_rand(); + test_lrand48(); + + ctx->main_task_id = rtems_task_self(); - test(); + /* Fill dynamic file pool in Newlib */ + file = fopen(CONSOLE_DEVICE_NAME, "r+"); + rtems_test_assert(file != NULL); + rv = fclose(file); + rtems_test_assert(rv == 0); - TEST_END(); - rtems_test_exit(0); + test_stdio_file(ctx); + test_non_stdio_file(ctx); + test_exit_handling(ctx); +} + +static void fatal_extension( + rtems_fatal_source source, + bool always_set_to_false, + rtems_fatal_code error +) +{ + if ( + source == RTEMS_FATAL_SOURCE_EXIT + && !always_set_to_false + && error == 0 + ) { + /* + * Final conditions check after exit handlers and Newlib cleanup procedures + * have run. File descriptors and FILE objects themselves are closed. + */ + struct stat unused; + int rv; + test_context *ctx = &test_instance; + + errno = 0; + rv = fstat(0, &unused); + rtems_test_assert(rv == -1); + rtems_test_assert(errno == EBADF); + + errno = 0; + rv = fstat(1, &unused); + rtems_test_assert(rv == -1); + rtems_test_assert(errno == EBADF); + + errno = 0; + rv = fstat(2, &unused); + rtems_test_assert(rv == -1); + rtems_test_assert(errno == EBADF); + + rtems_test_assert(stdin->_flags == 0); + rtems_test_assert(stdout->_flags == 0); + rtems_test_assert(stderr->_flags == 0); + + /* The non-stdio file and its file descriptor should be closed */ + errno = 0; + rv = fstat(ctx->non_stdio_fd, &unused); + rtems_test_assert(rv == -1); + rtems_test_assert(errno == EBADF); + rtems_test_assert(ctx->non_stdio_file->_flags == 0); + + TEST_END(); + } } #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER -#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 4 +#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 5 #define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION +#define CONFIGURE_INITIAL_EXTENSIONS \ + { .fatal = fatal_extension }, \ + RTEMS_TEST_INITIAL_EXTENSION #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/libtests/newlib01/newlib01.doc b/testsuites/libtests/newlib01/newlib01.doc index 2bf5959506..dc16584418 100644 --- a/testsuites/libtests/newlib01/newlib01.doc +++ b/testsuites/libtests/newlib01/newlib01.doc @@ -14,5 +14,11 @@ concepts: written to the open file during thread termination. - Ensure that the open file is closed after the write during thread termination. - - Ensure that all resources are returned to the system using resouce + - Ensure that all resources are returned to the system using resource snapshots. + - Check that exit procedures provide proper resource cleanup. Ensure that + a file opened from a worker task--but that is not assigned to a stdio + stream--is not closed during thread termination. + - Check that the state of random number generators is thread-specific, they + are properly initialized, and return the expected sequence for default + seed values. diff --git a/testsuites/libtests/ofw01/init.c b/testsuites/libtests/ofw01/init.c new file mode 100644 index 0000000000..6afed33475 --- /dev/null +++ b/testsuites/libtests/ofw01/init.c @@ -0,0 +1,216 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) <2020> Niteesh G S <niteesh.gs@gmail.com> + * + * 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 <tmacros.h> +#include <stdio.h> +#include <stdlib.h> +#include <libfdt.h> +#include <sys/endian.h> +#include <bsp/fdt.h> +#include <ofw/ofw.h> +#include <ofw/ofw_test.h> +#include <rtems/score/isr.h> + +#include "some.h" + +#define BUF_SIZE 100 + +const char rtems_test_name[] = "OFW 01"; +static const void *test_bin = NULL; + +const void *__wrap_bsp_fdt_get(void); +const void *__real_bsp_fdt_get(void); + +const void *__wrap_bsp_fdt_get(void) +{ + uintptr_t sp; + + sp = (uintptr_t) __builtin_frame_address(0); + RTEMS_OBFUSCATE_VARIABLE(sp); + + /* + * Use the stack pointer to check if we have to return the real device tree + * since bsp_fdt_get() may get called before the BSS is cleared to zero. + */ + if ( + (sp < (uintptr_t) _ISR_Stack_area_begin || + sp >= (uintptr_t) _ISR_Stack_area_end) && + test_bin != NULL + ) { + return test_bin; + } + +#ifdef BSP_FDT_IS_SUPPORTED + return __real_bsp_fdt_get(); +#else + return some_bin; +#endif +} + +static void Init(rtems_task_argument arg) +{ + int rv; + phandle_t d; + phandle_t l; + phandle_t t; + phandle_t c; + phandle_t a; + phandle_t b; + phandle_t q; + phandle_t root; + phandle_t temp; + uint32_t *arr; + char buf[BUF_SIZE]; + char *bufp; + ssize_t buf_len; + rtems_ofw_memory_area reg; + rtems_ofw_memory_area regs[2]; + rtems_vector_number intr; + rtems_vector_number intrs[2]; + TEST_BEGIN(); + buf_len = sizeof(buf); + + /* + * Reinitializing the OFW API to use the test + * FDT instead of the original FDT. + */ + test_bin = some_bin; + rtems_ofw_init(); + + /* + * Cannot use fdt_path_offset to compare because + * the OF interface uses the offset from the ftdp + * to the node as phandle. + */ + root = rtems_ofw_find_device("/"); + rtems_test_assert(root == 56); + + root = rtems_ofw_peer(0); + rtems_test_assert(root == 56); + + d = rtems_ofw_child(root); + temp = rtems_ofw_find_device("/d"); + rtems_test_assert(d == temp); + + temp = rtems_ofw_parent(d); + rtems_test_assert(root == temp); + + rv = rtems_ofw_get_prop(d, "e", buf, buf_len); + rtems_test_assert(rv != -1); + rtems_test_assert(strcmp(buf, "f") == 0); + + rv = rtems_ofw_has_prop(d, "g"); + rtems_test_assert(rv == 1); + + rv = rtems_ofw_get_prop_len(root, "model"); + rtems_test_assert(rv == 2); + + rv = rtems_ofw_next_prop(d, "e", buf, buf_len); + rtems_test_assert(rv == 1); + rtems_test_assert(strcmp(buf, "g") == 0); + + l = rtems_ofw_find_device("/m@1248"); + rv = rtems_ofw_search_prop(l, "model", buf, buf_len); + rtems_test_assert(rv != -1); + rtems_test_assert(strcmp(buf, "c") == 0); + + rv = rtems_ofw_get_prop_alloc(root, "compatible", (void **)&bufp); + rtems_test_assert(rv != -1); + rtems_test_assert(strcmp(bufp, "a,b") == 0); + + rtems_ofw_free(bufp); + rv = rtems_ofw_get_prop_alloc_multi(l, "n", sizeof(*arr), (void **)&arr); + rtems_test_assert(rv == 2); + rtems_test_assert(arr[0] == htobe32(0xdeadbeef)); + rtems_test_assert(arr[1] == htobe32(0x12345678)); + + rv = rtems_ofw_get_enc_prop_alloc_multi(l, "n", sizeof(*arr), (void **)&arr); + rtems_test_assert(rv == 2); + rtems_test_assert(arr[0] == 0xdeadbeef); + rtems_test_assert(arr[1] == 0x12345678); + + t = rtems_ofw_find_device("/t"); + rv = rtems_ofw_next_prop(t, "u", buf, buf_len); + rtems_test_assert(rv == 0); + + rv = rtems_ofw_next_prop(d, "e", buf, buf_len); + rtems_test_assert(rv == 1); + + a = rtems_ofw_find_device("/a"); + rv = rtems_ofw_get_reg(a, ®, sizeof(reg)); + rtems_test_assert(rv == 1); + rtems_test_assert(reg.start == 0x1234); + rtems_test_assert(reg.size == 0x10); + + b = rtems_ofw_find_device("/a/b"); + rv = rtems_ofw_get_reg(b, ®s[0], sizeof(regs)); + rtems_test_assert(rv == 2); + rtems_test_assert(regs[0].start == 0x8234); + rtems_test_assert(regs[0].size == 0x10); + rtems_test_assert(regs[1].start == 0xf468); + rtems_test_assert(regs[1].size == 0x10); + + c = rtems_ofw_find_device("/c"); + rv = rtems_ofw_get_reg(c, ®, sizeof(reg)); + rtems_test_assert(rv == -1); + + a = rtems_ofw_find_device("/a"); + rv = rtems_ofw_get_interrupts(a, &intr, sizeof(intr)); + rtems_test_assert(rv == 1); + rtems_test_assert(intr == 0x1); + + c = rtems_ofw_find_device("/c"); + rv = rtems_ofw_get_interrupts(c, &intrs[0], sizeof(intrs)); + rtems_test_assert(rv == 2); + rtems_test_assert(intrs[0] == 0x1); + rtems_test_assert(intrs[1] == 0x2); + + q = rtems_ofw_find_device("/c/q"); + rv = rtems_ofw_node_status(q); + rtems_test_assert(rv == true); + + TEST_END(); + test_bin = NULL; + rtems_test_exit(0); +} + +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT + +#include <rtems/confdefs.h> diff --git a/testsuites/libtests/ofw01/ofw01.doc b/testsuites/libtests/ofw01/ofw01.doc new file mode 100644 index 0000000000..6a28c847d8 --- /dev/null +++ b/testsuites/libtests/ofw01/ofw01.doc @@ -0,0 +1,29 @@ +This file describes the directives and concepts tested by this test set. + +test set name: openfirmware01 + +directives: + + - rtems_ofw_peer + - rtems_ofw_child + - rtems_ofw_parent + - rtems_ofw_get_prop_len + - rtems_ofw_get_prop + - rtems_ofw_get_enc_prop + - rtems_ofw_has_prop + - rtems_ofw_search_prop + - rtems_ofw_search_enc_prop + - rtems_ofw_get_prop_alloc + - rtems_ofw_get_prop_alloc_multi + - rtems_ofw_get_enc_prop_alloc + - rtems_ofw_get_enc_prop_alloc_multi + - rtems_ofw_free + - rtems_ofw_next_prop + - rtems_ofw_set_prop + - rtems_ofw_canon + - rtems_ofw_find_device + - rtems_ofw_package_to_path + +concepts: + + - Ensure that some openfimware functions work as expected. diff --git a/testsuites/libtests/ofw01/ofw01.scn b/testsuites/libtests/ofw01/ofw01.scn new file mode 100644 index 0000000000..007675e374 --- /dev/null +++ b/testsuites/libtests/ofw01/ofw01.scn @@ -0,0 +1,2 @@ +*** BEGIN OF TEST OFW 1 *** +*** END OF TEST OFW 1 ***
\ No newline at end of file diff --git a/testsuites/libtests/ofw01/some.c b/testsuites/libtests/ofw01/some.c new file mode 100644 index 0000000000..7ce8760316 --- /dev/null +++ b/testsuites/libtests/ofw01/some.c @@ -0,0 +1,72 @@ +/* + * Declarations for C structure representing binary file some.bin + * + * WARNING: Automatically generated -- do not edit! + */ + +#include <rtems.h> + +RTEMS_ALIGNED(8) const unsigned char some_bin[] = { + 0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x02, 0xcf, 0x00, 0x00, 0x00, 0x38, + 0x00, 0x00, 0x02, 0x70, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, + 0x00, 0x00, 0x02, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x61, 0x2c, 0x62, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1a, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x26, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x09, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x01, + 0x68, 0x40, 0x30, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, + 0x68, 0x40, 0x31, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x61, 0x6c, 0x69, 0x61, + 0x73, 0x65, 0x73, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x30, 0x2f, 0x6d, 0x40, 0x31, 0x32, 0x34, 0x38, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x6d, 0x40, 0x31, 0x32, + 0x34, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x32, 0xde, 0xad, 0xbe, 0xef, 0x12, 0x34, 0x56, 0x78, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x34, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x6f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x71, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, + 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x01, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x61, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x12, 0x34, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x46, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x4d, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x62, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x42, + 0x00, 0x00, 0x12, 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x24, 0x68, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x01, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, + 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x58, + 0x6f, 0x6b, 0x61, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, + 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x00, 0x23, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2d, 0x63, 0x65, 0x6c, 0x6c, + 0x73, 0x00, 0x23, 0x73, 0x69, 0x7a, 0x65, 0x2d, 0x63, 0x65, 0x6c, 0x6c, + 0x73, 0x00, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x67, 0x00, 0x77, 0x00, + 0x6b, 0x00, 0x6e, 0x00, 0x70, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x00, + 0x70, 0x00, 0x72, 0x00, 0x75, 0x00, 0x72, 0x65, 0x67, 0x00, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x00, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x75, + 0x70, 0x74, 0x73, 0x00, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x00, +}; + +const size_t some_bin_size = sizeof(some_bin); diff --git a/testsuites/libtests/ofw01/some.dts b/testsuites/libtests/ofw01/some.dts new file mode 100644 index 0000000000..6a5023414f --- /dev/null +++ b/testsuites/libtests/ofw01/some.dts @@ -0,0 +1,89 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (c) 2020 Niteesh G S <niteesh.gs@gmail.com>. All rights reserved. + * Copyright (c) 2015 embedded brains GmbH & Co. KG + * + * 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. + */ + +/dts-v1/; + +/ { + compatible = "a,b"; + #address-cells = <1>; + #size-cells = <2>; + model = "c"; + + d { + e = "f"; + g; + + h@0 { + }; + + h@1 { + w = <123>; + }; + }; + + aliases { + k = "/m@1248"; + }; + + l: m@1248 { + n = <0xdeadbeef 0x12345678>; + + o { + p; + }; + + q { + r = "s"; + }; + }; + + t { + u = <&l>; + }; + + a { + compatible = "a"; + reg = <0x1234 0x10>; + ranges = <0x1000 0x8000 0x400 0x2000 0xF000 0x1000>; + interrupts = <0x1>; + + b { + reg = <0x1234 0x10 0x2468 0x10>; + }; + }; + + c { + ranges; + interrupts = <0x1 0x2 0x3>; + + q { + reg = <0x4800 0x200>; + status = "okay"; + }; + }; +}; diff --git a/testsuites/libtests/ofw01/some.h b/testsuites/libtests/ofw01/some.h new file mode 100644 index 0000000000..e2e0135e68 --- /dev/null +++ b/testsuites/libtests/ofw01/some.h @@ -0,0 +1,15 @@ +/* + * Extern declarations for C structure representing binary file some.bin + * + * WARNING: Automatically generated -- do not edit! + */ + +#ifndef __some_h +#define __some_h + +#include <sys/types.h> + +extern const unsigned char some_bin[]; +extern const size_t some_bin_size; + +#endif diff --git a/testsuites/libtests/putenvtest/init.c b/testsuites/libtests/putenvtest/init.c index 74cd8de1a8..748b023908 100644 --- a/testsuites/libtests/putenvtest/init.c +++ b/testsuites/libtests/putenvtest/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Init * * This routine is the initialization task for this test program. @@ -14,9 +16,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/putenvtest/putenvtest.doc b/testsuites/libtests/putenvtest/putenvtest.doc index 273027956d..ec47d4d21c 100644 --- a/testsuites/libtests/putenvtest/putenvtest.doc +++ b/testsuites/libtests/putenvtest/putenvtest.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 2014. # On-Line Applications Research Corporation (OAR). # Cynthia Rempel <cynthia@rtems.org> -# 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. diff --git a/testsuites/libtests/pwdgrp01/init.c b/testsuites/libtests/pwdgrp01/init.c index 254eb695ef..e241237272 100644 --- a/testsuites/libtests/pwdgrp01/init.c +++ b/testsuites/libtests/pwdgrp01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/pwdgrp02/init.c b/testsuites/libtests/pwdgrp02/init.c index 85770a7a8d..3fb74b226c 100644 --- a/testsuites/libtests/pwdgrp02/init.c +++ b/testsuites/libtests/pwdgrp02/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/rbheap01/init.c b/testsuites/libtests/rbheap01/init.c index 71429dfba4..ab6d36ec34 100644 --- a/testsuites/libtests/rbheap01/init.c +++ b/testsuites/libtests/rbheap01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012-2015 embedded brains GmbH. All rights reserved. + * Copyright (C) 2012, 2015 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/rbheap01/rbheap.doc b/testsuites/libtests/rbheap01/rbheap.doc index b86cc692a6..bc64fb2679 100644 --- a/testsuites/libtests/rbheap01/rbheap.doc +++ b/testsuites/libtests/rbheap01/rbheap.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 2014. # On-Line Applications Research Corporation (OAR). # Cynthia Rempel <cynthia@rtems.org> -# 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. diff --git a/testsuites/libtests/rcxx01/init.c b/testsuites/libtests/rcxx01/init.c new file mode 100644 index 0000000000..bea71d14c7 --- /dev/null +++ b/testsuites/libtests/rcxx01/init.c @@ -0,0 +1,89 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2020 Chris Johns (http://contemporary.software) + * + * 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 <bsp.h> + +#include <stdlib.h> +#include <stdio.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <unistd.h> +#include "tmacros.h" + +const char rtems_test_name[] = "RCXX 1"; + +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + +void rcxx_run_test(void); + +rtems_task Init( + rtems_task_argument ignored +) +{ + TEST_BEGIN(); + + rcxx_run_test(); + + TEST_END(); + rtems_test_exit( 0 ); +} + +/* configuration information */ + +#include <rtems/serial_mouse.h> + +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER + +#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 5 + +#define CONFIGURE_MEMORY_OVERHEAD (2024) + +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_POSIX_THREADS 5 + +#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT_TASK_STACK_SIZE (10U * 1024U) + +#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT + +#define CONFIGURE_INIT + +#include <rtems/confdefs.h> + +/* end of file */ diff --git a/testsuites/libtests/rcxx01/rcxx01.doc b/testsuites/libtests/rcxx01/rcxx01.doc new file mode 100644 index 0000000000..3fd41b029b --- /dev/null +++ b/testsuites/libtests/rcxx01/rcxx01.doc @@ -0,0 +1,16 @@ +# Copyright (c) 2019 Chris Johns <chrisj@rtems.org> +# + +This file describes the directives and concepts tested by this test set. + +test set name: rcxx01 + +directives: + + rtems::thread::thread + rtems::thread::attributes + +concepts: + ++ Create a thread using the default method, ie like std::thread. +* Create a thread with changed attributes. diff --git a/testsuites/libtests/rcxx01/rcxx01.scn b/testsuites/libtests/rcxx01/rcxx01.scn new file mode 100644 index 0000000000..37bf2d3f7a --- /dev/null +++ b/testsuites/libtests/rcxx01/rcxx01.scn @@ -0,0 +1,13 @@ +*** BEGIN OF TEST RCXX 1 *** +*** TEST VERSION: 5.0.0.7ba04a62227286dcd3da20ea7319d9c64b8f5fd1 +*** TEST STATE: EXPECTED-PASS +*** TEST BUILD: +*** TEST TOOLS: 7.5.0 20191114 (RTEMS 5, RSB ceb811fa19ddcfdd449a8da8f1107e6e592727b6, Newlib d14714c69) +Thread: start: default + 1 D +Thread: start: attr + 2 R +Thread: end: default +Thread: end: attr + +*** END OF TEST RCXX 1 *** diff --git a/testsuites/libtests/rcxx01/thread.cpp b/testsuites/libtests/rcxx01/thread.cpp new file mode 100644 index 0000000000..f977a340a9 --- /dev/null +++ b/testsuites/libtests/rcxx01/thread.cpp @@ -0,0 +1,123 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2020 Chris Johns (http://contemporary.software) + * + * 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. + */ + +#include <chrono> +#include <iostream> +#include <thread> +#include <mutex> + +#include <rtems/thread.hpp> + +using namespace std::chrono_literals; + +extern "C" void rcxx_run_test(void); + +void example_1(); +void example_2(); +void example_3(); + +struct test_thread +{ + test_thread(); + + void start(); + bool running(); + void body(const char* title, int i, char c); + + rtems::thread::thread thread_default; + rtems::thread::thread thread_attr; + + std::mutex mutex; + + bool finished; +}; + +test_thread::test_thread() + : finished(false) +{ +} + +void test_thread::start() +{ + thread_default = rtems::thread::thread(&test_thread::body, this, + "default", 1, 'D'); + + rtems::thread::attributes attr; + + attr.set_name("RTHREAD"); + attr.set_priority(5); + attr.set_stack_size(32 * 1024); + + thread_attr = rtems::thread::thread(attr, &test_thread::body, this, + "attr", 2, 'R'); +} + +void test_thread::body(const char* title, int i, char c) +{ + std::cout << "Thread: start: " << title << std::endl + << ' ' << i << ' ' << c << std::endl; + + size_t count = 5; + + while (count--) { + std::this_thread::sleep_for(1s); + } + + std::cout << "Thread: end: " << title << std::endl; + + std::lock_guard<std::mutex> lock(mutex); + + finished = true; +} + +bool test_thread::running() +{ + std::lock_guard<std::mutex> lock(mutex); + return finished == false; +} + +void test_1() +{ + test_thread tt; + tt.start(); + while (tt.running()) + std::this_thread::sleep_for(1s); +} + +void rcxx_run_test(void) +{ + try { + test_1(); + /* From the user manual */ + example_1(); + example_2(); + example_3(); + } catch (...) { + std::cout << "Thread: ouch" << std::endl; + throw; + } +} diff --git a/testsuites/libtests/rcxx01/user-example-1.cpp b/testsuites/libtests/rcxx01/user-example-1.cpp new file mode 100644 index 0000000000..dfc0992193 --- /dev/null +++ b/testsuites/libtests/rcxx01/user-example-1.cpp @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2020 Chris Johns (http://contemporary.software) + * + * 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. + */ + +#include <chrono> +#include <iostream> + +#include <rtems/thread.hpp> + +static void wait_for(size_t seconds) +{ + while (seconds--) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + std::cout << "Seconds: " << seconds << std::endl; + } +} + +void example_1() +{ + std::cout << "Start example 1" << std::endl; + + rtems::thread::thread t(wait_for, 5); + t.join(); + + std::cout << "End example 1" << std::endl; +} diff --git a/testsuites/libtests/rcxx01/user-example-2.cpp b/testsuites/libtests/rcxx01/user-example-2.cpp new file mode 100644 index 0000000000..05090fc73c --- /dev/null +++ b/testsuites/libtests/rcxx01/user-example-2.cpp @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2020 Chris Johns (http://contemporary.software) + * + * 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. + */ + +#include <chrono> +#include <iostream> + +#include <rtems/thread.hpp> + +static void wait_for(std::string me, size_t seconds, size_t announce) +{ + size_t count = 0; + while (count < seconds) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + if ((count % announce) == 0) + std::cout << me << ": " << count << std::endl; + count++; + } +} + +void example_2() +{ + std::cout << "Start example 2" << std::endl; + + rtems::thread::attributes attr; + attr.set_stack_size(16 * 1024); + + attr.set_priority(100); + attr.set_name("T1"); + rtems::thread::thread t1(attr, wait_for, "T1", 10, 1); + + attr.set_priority(101); + attr.set_name("T2"); + rtems::thread::thread t2(attr, wait_for, "T2", 10, 2); + + attr.set_priority(attr.get_priority()); + attr.set_name("T3"); + rtems::thread::thread t3(attr, wait_for, "T3", 15, 3); + + t1.join(); + t2.join(); + t3.join(); + + std::cout << "End example 2" << std::endl; +} diff --git a/testsuites/libtests/rcxx01/user-example-3.cpp b/testsuites/libtests/rcxx01/user-example-3.cpp new file mode 100644 index 0000000000..9d8f84894a --- /dev/null +++ b/testsuites/libtests/rcxx01/user-example-3.cpp @@ -0,0 +1,110 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/* + * Copyright (C) 2020 Chris Johns (http://contemporary.software) + * + * 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. + */ + +#include <atomic> +#include <chrono> +#include <iostream> +#include <mutex> + +#include <rtems/thread.hpp> + +class ticker +{ + public: + ticker(); + + void start(const size_t life_time); + bool finished(); + + size_t seconds(); + + private: + void timer(const size_t life_time); + + rtems::thread::thread tocker; + std::mutex lock; + std::atomic<bool> done; + bool running; + std::atomic<size_t> the_seconds; +}; + +ticker::ticker() + : done(false), + running(false), + the_seconds(0) +{ +} + +void ticker::start(const size_t life_time) +{ + std::lock_guard<std::mutex> guard(lock); + if (!running) { + rtems::thread::attributes attr; + attr.set_name("CLCK"); + attr.set_stack_size(8 * 1024); + attr.set_priority(10); + running = true; + tocker = rtems::thread::thread(attr, &ticker::timer, this, life_time); + } +} + +bool ticker::finished() +{ + return done.load(); +} + +size_t ticker::seconds() +{ + return the_seconds.load(); +} + +void ticker::timer(const size_t life_time) +{ + while (the_seconds.load() < life_time) { + std::this_thread::sleep_for(std::chrono::seconds(1)); + the_seconds++; + } + done = true; + std::lock_guard<std::mutex> guard(lock); + running = false; +} + +void example_3() +{ + std::cout << "Start example 3" << std::endl; + + ticker my_ticker; + + my_ticker.start(5); + + while (!my_ticker.finished()) { + std::this_thread::sleep_for(std::chrono::seconds(2)); + std::cout << "Ticker is " << my_ticker.seconds() << std::endl; + } + + std::cout << "End example 3" << std::endl; +} diff --git a/testsuites/libtests/record01/init.c b/testsuites/libtests/record01/init.c index fea509089a..eb257b8a2e 100644 --- a/testsuites/libtests/record01/init.c +++ b/testsuites/libtests/record01/init.c @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/record02/init.c b/testsuites/libtests/record02/init.c index 7568f06e18..3c4dac25a0 100644 --- a/testsuites/libtests/record02/init.c +++ b/testsuites/libtests/record02/init.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-2-Clause */ /* - * Copyright (C) 2018, 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2018, 2020 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/libtests/regulator01/regulator01.c b/testsuites/libtests/regulator01/regulator01.c new file mode 100644 index 0000000000..cc5af01223 --- /dev/null +++ b/testsuites/libtests/regulator01/regulator01.c @@ -0,0 +1,1310 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @defgroup RegulatorTests Regulator Test Cases + * + * @brief Unit test cases for the Regulator + * + * This is a set of unit test cases for the regulator. + */ + +/** + * @ingroup RegulatorTests + * + * @file + * + * @brief Test 01 for Regulator Library + */ + +/* + * 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. + */ + +#include <stdio.h> +#include <string.h> +#include <unistd.h> + +#include <rtems.h> +#include <rtems/test-info.h> +#include <tmacros.h> + +#include <rtems/regulator.h> + +/** + * @brief Regulator Test Name + */ +const char rtems_test_name[] = "Regulator 1"; + +/* + * Prototypes for wrapped functions + */ +void *__wrap_malloc(size_t size); +void *__real_malloc(size_t size); + +/** + * @ingroup RegulatorTests + * @brief Calloc Wrapper Trigger Count + */ +static int malloc_trigger_count; + +/** + * @ingroup RegulatorTests + * @brief Calloc Wrapper Call Count + */ +static int malloc_call_count; + +/** + * @ingroup RegulatorTests + * @brief Calloc Wrapper Trigger enable + */ +static bool malloc_trigger_enabled; + +/** + * @ingroup RegulatorTests + * @brief Enable Calloc Wrapper Trigger + */ +static void malloc_trigger_enable( + int trigger_count +) +{ + malloc_trigger_enabled = true; + malloc_trigger_count = trigger_count; + malloc_call_count = 0; +} +/** + * @ingroup RegulatorTests + * @brief Reset Calloc Wrapper Trigger and Count + */ +static void malloc_trigger_reset(void) +{ + malloc_trigger_enabled = 0; + malloc_trigger_count = 0; + malloc_call_count = 0; +} +/** + * @ingroup RegulatorTests + * @brief Calloc Wrapper to Trigger Allocation Errors + */ +void *__wrap_malloc(size_t size) +{ + if (malloc_trigger_enabled) { + malloc_call_count++; + if (malloc_call_count == malloc_trigger_count) { + return NULL; + } + } + + return __real_malloc(size); +} + +/** + * @brief Constant to simpify code + */ +#define FIVE_SECONDS (5 * rtems_clock_get_ticks_per_second()) + +/** + * @ingroup RegulatorTests + * @brief Empty Deliver Method for Testing + */ +static bool test_regulator_deliverer( + void *context, + void *message, + size_t length +) +{ + (void) context; + (void) message; + (void) length; + + return true; +} + +/** + * @ingroup RegulatorTests + * @brief Maximum length of a test message that is delivered + */ +#define MAXIMUM_MESSAGE_LENGTH 32 + +/** + * @ingroup RegulatorTests + * @brief Maximum number of test messages to buffer + */ +#define MAXIMUM_MESSAGES_TO_BUFFER 10 + +/** + * @ingroup RegulatorTests + * @brief Structure for capturing messages as delivered + */ +typedef struct { + rtems_interval processed; + char message[MAXIMUM_MESSAGE_LENGTH]; +} message_log_t; + +/** + * @ingroup RegulatorTests + * @brief Set of Delivered messages + */ +message_log_t delivered_messages[MAXIMUM_MESSAGES_TO_BUFFER]; + +/** + * @ingroup RegulatorTests + * @brief Count of Delivered messages + */ +int delivered_message_count; + +/** + * @ingroup RegulatorTests + * @brief Reset Delivered Message Set + * + * This is used at the beginning of a test case which is going to + * check that message contents and delivery times were as expected. + */ +static void delivered_messages_reset(void) +{ + delivered_message_count = 0; + memset(delivered_messages, 0xc5, sizeof(delivered_messages)); +} + +/** + * @brief Context for Logger Delivery Function + */ +typedef struct { + /** Regulator instance being operated on */ + rtems_regulator_instance *regulator; +} deliverer_logger_context_t; + +/** + * @brief Context Instance for Logger Delivery Function + */ +static deliverer_logger_context_t deliverer_logger_context; + +/** + * @ingroup RegulatorTests + * @brief Empty Deliver Method for Testing + * + * This deliverer method implementation logs the messages along with + * their time of arrival. This is used by the test cases to verify + * proper delivery. + */ +static bool test_regulator_deliverer_logger( + void *context, + void *message, + size_t length +) +{ + deliverer_logger_context_t *the_context; + + the_context = (deliverer_logger_context_t *)context; + + static bool caller_releases_buffer = true; + + size_t len; + rtems_interval ticks; + rtems_status_code sc; + + len = strnlen(message, MAXIMUM_MESSAGE_LENGTH) + 1; + rtems_test_assert(len = length); + + ticks = rtems_clock_get_ticks_since_boot(); + + delivered_messages[delivered_message_count].processed = ticks; + + strcpy(delivered_messages[delivered_message_count].message, message); + + delivered_message_count++; + + /* + * Alternate releasing the buffer here and allowing the calling Delivery + * Thread to do it. This increases coverage of that logic. + */ + if (caller_releases_buffer == true) { + caller_releases_buffer = false; + return true; + } + + sc = rtems_regulator_release_buffer(the_context->regulator, message); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + return false; +} + + +/** + * @ingroup RegulatorTests + * @brief Helper to create a Regulator instance + * + * This helper creates a regulator instance with some arbitrary attributes. + * This is used in multiple test cases to have a valie regulator instance to + * trigger error cases. + */ +static rtems_regulator_instance *test_regulator_create_regulator_OK(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes = { + .deliverer = test_regulator_deliverer, + .deliverer_context = NULL, + .maximum_message_size = 16, + .maximum_messages = 10, + .delivery_thread_priority = 16, + .delivery_thread_stack_size = 0, + .delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000), + .maximum_to_dequeue_per_period = 3 + }; + rtems_regulator_instance *regulator; + + regulator = NULL; + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(regulator != NULL); + + return regulator; +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create() maximum_to_dequeue_per_period + * attributes error + * + * This unit test verifies that rtems_regulator_create() returns an error when + * the maximum_to_dequeue_per_period attribute is zero. + */ +static void test_regulator_create_max_dequeue_zero(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes = { + .deliverer = test_regulator_deliverer, + .deliverer_context = NULL, + .maximum_message_size = 16, + .maximum_messages = 10, + .delivery_thread_priority = 16, + .delivery_thread_stack_size = 0, + .delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000), + .maximum_to_dequeue_per_period = 0 + }; + rtems_regulator_instance *regulator; + + regulator = NULL; + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_INVALID_NUMBER); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create() NULL attributes error + * + * This unit test verifies that rtems_regulator_create() returns an error when + * the attributes argument is NULL. + */ +static void test_regulator_create_null_attributes(void) +{ + rtems_status_code sc; + rtems_regulator_instance *regulator; + + sc = rtems_regulator_create(NULL, ®ulator); + rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create NULL regulator error + * + * This unit test verifies that rtems_regulator_create() returns an error when + * the regulator argument is NULL. + */ +static void test_regulator_create_null_regulator(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes; + + sc = rtems_regulator_create(&attributes, NULL); + rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create deliverer is NULL + * + * This unit test verifies that rtems_regulator_create() returns an error when + * the the attributes deliverer field is NULL. + */ +static void test_regulator_create_deliverer_is_null(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = NULL; + attributes.maximum_messages = 0; + attributes.maximum_message_size = 16; + attributes.maximum_to_dequeue_per_period = 1; + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create maximum_messages is 0 error + * + * This unit test verifies that rtems_regulator_create() returns an error when + * the the attributes maximum_messages field is 0. + */ +static void test_regulator_create_maximum_messages_is_zero(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 0; + attributes.maximum_message_size = 16; + attributes.maximum_to_dequeue_per_period = 1; + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_INVALID_NUMBER); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create maximum_message_size is 0 error + * + * This unit test verifies that rtems_regulator_create() returns an error when + * the the attributes maximum_message_size field is 0. + */ +static void test_regulator_create_maximum_message_size_is_zero(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 0; + attributes.maximum_to_dequeue_per_period = 1; + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_INVALID_SIZE); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create maximum_to_dequeue_per_period is 0 error + * + * This unit test verifies that rtems_regulator_create() returns an error when + * the the attributes maximum_to_dequeue_per_period field is 0. + */ +static void test_regulator_create_maximum_to_dequeue_per_period_is_zero(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 0; + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_INVALID_SIZE); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create returns error on failure to allocate regulator + * + * This unit test verifies that rtems_regulator_create() returns an error when + * it is unable to allocate the mmemory for the regulator instance. + */ +static void test_regulator_create_malloc_regulator_fails(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 16; + attributes.delivery_thread_priority = 32; + attributes.maximum_to_dequeue_per_period = 1; + attributes.delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000); + + malloc_trigger_enable(1); + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_NO_MEMORY); + + malloc_trigger_reset(); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create returns error on failure to allocate buffers + * + * This unit test verifies that rtems_regulator_create() returns an error when + * it is unable to allocate the mmemory for the regulator buffers. + */ +static void test_regulator_create_malloc_buffers_fails(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 16; + attributes.delivery_thread_priority = 32; + attributes.maximum_to_dequeue_per_period = 1; + attributes.delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000); + + malloc_trigger_enable(2); + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_NO_MEMORY); + + malloc_trigger_reset(); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create and delete work + * + * This unit test verifies that rtems_regulator_create() can successfully create + * the the attributes delivery_thread_priority field is 0. + */ +static void test_regulator_create_delivery_thread_priority_is_zero(void) +{ + rtems_status_code sc; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 16; + attributes.delivery_thread_priority = 0; + attributes.maximum_to_dequeue_per_period = 1; + attributes.delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000); + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_INVALID_PRIORITY); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create rtems_partition_create error + * + * This unit test verifies that rtems_regulator_create() correctly returns an + * error when the call to rtems_partition_create() fails. + */ +static void test_regulator_create_partition_create_fails(void) +{ + rtems_status_code sc; + rtems_id partition_id; + unsigned long partition_area[16]; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + sc = rtems_partition_create( + rtems_build_name('T', 'P', 'T', 'P'), + partition_area, + 16 * sizeof(unsigned long), + 2 * sizeof(unsigned long), + RTEMS_DEFAULT_ATTRIBUTES, + &partition_id + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 16; + attributes.delivery_thread_priority = 8; + attributes.maximum_to_dequeue_per_period = 1; + attributes.delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000); + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_TOO_MANY); + + sc = rtems_partition_delete(partition_id); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create rtems_message_queue_create error + * + * This unit test verifies that rtems_regulator_create() correctly returns an + * error when the call to rtems_message_queue_create() fails. + */ +static void test_regulator_create_message_queue_create_fails(void) +{ + rtems_status_code sc; + rtems_id queue_id; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + sc = rtems_message_queue_create( + rtems_build_name('T', 'Q', 'T', 'Q'), + 4, + sizeof(unsigned long), + RTEMS_DEFAULT_ATTRIBUTES, + &queue_id + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 16; + attributes.delivery_thread_priority = 8; + attributes.maximum_to_dequeue_per_period = 1; + attributes.delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000); + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_TOO_MANY); + + sc = rtems_message_queue_delete(queue_id); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_create rtems_task_create error + * + * This unit test verifies that rtems_regulator_create() correctly returns an + * error when the call to rtems_task_create() fails. + */ +static void test_regulator_create_task_create_fails(void) +{ + rtems_status_code sc; + rtems_id task_id; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + sc = rtems_task_create( + rtems_build_name('T', 'T', 'T', 'T'), + 80, + 0, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &task_id + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 16; + attributes.delivery_thread_priority = 8; + attributes.maximum_to_dequeue_per_period = 1; + attributes.delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000); + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_TOO_MANY); + + sc = rtems_task_delete(task_id); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +/** + * @ingroup RegulatorTests + * @brief Verify Regulator Output Thread Handles Error on Period Create + * + * This unit test verifies that regulator output thread correctly exits + * when the call to rtems_rate_monotonic_create() fails. + * + * This error condition/path cannot be directly detected via a return code, + * It is verified via a debugger or code coverage reports. + */ +static void test_regulator_create_rate_monotonic_create_fails(void) +{ + rtems_status_code sc; + rtems_id period_id; + rtems_regulator_attributes attributes; + rtems_regulator_instance *regulator; + + sc = rtems_rate_monotonic_create( + rtems_build_name('T', 'S', 'T', 'P'), + &period_id + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + (void) memset(&attributes, 0, sizeof(rtems_regulator_attributes)); + + attributes.deliverer = test_regulator_deliverer; + attributes.maximum_messages = 10; + attributes.maximum_message_size = 16; + attributes.delivery_thread_priority = 8; + attributes.maximum_to_dequeue_per_period = 1; + attributes.delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000); + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + /* + * Let the output thread execute and encounter the create error. + */ + + sleep(1); + + /* + * Now deallocate the resources allocated earlier + */ + sc = rtems_regulator_delete(regulator, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_rate_monotonic_delete(period_id); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_delete NULL regulator error + * + * This unit test verifies that rtems_regulator_delete() returns an error when + * the regulator argument is NULL. + */ +static void test_regulator_delete_null_regulator(void) +{ + rtems_status_code sc; + + sc = rtems_regulator_delete(NULL, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_delete uninitialized regulator error + * + * This unit test verifies that rtems_regulator_delete() returns an error when + * the regulator argument is uninitialized. + */ +static void test_regulator_delete_uninitialized_regulator(void) +{ + rtems_status_code sc; + rtems_regulator_instance regulator; + + (void) memset(®ulator, 0, sizeof(regulator)); + + sc = rtems_regulator_delete(®ulator, 0); + rtems_test_assert(sc == RTEMS_INCORRECT_STATE); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_delete successful case + * + * This unit test verifies that rtems_regulator_delete() can be successfully + * deleted. + */ +static void test_regulator_delete_OK(void) +{ + rtems_status_code sc; + rtems_regulator_instance *regulator; + + regulator = test_regulator_create_regulator_OK(); + rtems_test_assert(regulator != NULL); + + sc = rtems_regulator_delete(regulator, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_obtain_buffer NULL regulator error + * + * This unit test verifies that rtems_regulator_obtain_buffer() returns an error when + * the regulator argument is NULL. + */ +static void test_regulator_obtain_buffer_null_regulator(void) +{ + rtems_status_code sc; + void *buffer; + + sc = rtems_regulator_obtain_buffer(NULL, &buffer); + rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_obtain_buffer uninitialized regulator error + * + * This unit test verifies that rtems_regulator_obtain_buffer() returns an error when + * the regulator argument is uninitialized. + */ +static void test_regulator_obtain_buffer_uninitialized_regulator(void) +{ + rtems_status_code sc; + rtems_regulator_instance regulator; + void *buffer; + + (void) memset(®ulator, 0, sizeof(regulator)); + + sc = rtems_regulator_obtain_buffer(®ulator, &buffer); + rtems_test_assert(sc == RTEMS_INCORRECT_STATE); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_obtain_buffer successful case + * + * This unit test verifies that rtems_regulator_obtain_buffer() can be successfully + * obtained from an initialized regulator. + */ +static void test_regulator_obtain_buffer_OK(void) +{ + rtems_status_code sc; + rtems_regulator_instance *regulator; + void *buffer; + + regulator = test_regulator_create_regulator_OK(); + rtems_test_assert(regulator != NULL); + + sc = rtems_regulator_obtain_buffer(regulator, &buffer); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(buffer != NULL); + + /* + * Not really testing this here but cannot delete underlying partition + * if there are buffers outstanding. + */ + sc = rtems_regulator_release_buffer(regulator, buffer); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(buffer != NULL); + + sc = rtems_regulator_delete(regulator, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_release_buffer NULL regulator error + * + * This unit test verifies that rtems_regulator_release_buffer() returns an error when + * the regulator argument is NULL. + */ +static void test_regulator_release_buffer_null_regulator(void) +{ + rtems_status_code sc; + void *buffer; + + sc = rtems_regulator_release_buffer(NULL, &buffer); + rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_release_buffer uninitialized regulator error + * + * This unit test verifies that rtems_regulator_release_buffer() returns an + * error when the regulator argument is uninitialized. + */ +static void test_regulator_release_buffer_uninitialized_regulator(void) +{ + rtems_status_code sc; + rtems_regulator_instance regulator; + void *buffer; + + (void) memset(®ulator, 0, sizeof(regulator)); + + sc = rtems_regulator_release_buffer(®ulator, &buffer); + rtems_test_assert(sc == RTEMS_INCORRECT_STATE); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_release_buffer successful case + * + * This unit test verifies that rtems_regulator_release_buffer() can be successfully + * invoked with a buffer previously allocated by rtems_regulator_obtain_buffer(). + */ +static void test_regulator_release_buffer_OK(void) +{ + rtems_status_code sc; + rtems_regulator_instance *regulator; + void *buffer; + + regulator = test_regulator_create_regulator_OK(); + rtems_test_assert(regulator != NULL); + + sc = rtems_regulator_obtain_buffer(regulator, &buffer); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(buffer != NULL); + + sc = rtems_regulator_release_buffer(regulator, buffer); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_regulator_delete(regulator, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_send NULL regulator error + * + * This unit test verifies that rtems_regulator_send() returns an error when + * the regulator argument is NULL. + */ +static void test_regulator_send_null_regulator(void) +{ + rtems_status_code sc; + void *buffer; + size_t length; + + buffer = &length; + length = sizeof(size_t); + + sc = rtems_regulator_send(NULL, buffer, length); + rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_send NULL message error + * + * This unit test verifies that rtems_regulator_send() returns an error when + * the message argument is NULL. + */ +static void test_regulator_send_null_message(void) +{ + rtems_status_code sc; + size_t length; + rtems_regulator_instance regulator; + + length = sizeof(size_t); + + sc = rtems_regulator_send(®ulator, NULL, length); + rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_send zero length message error + * + * This unit test verifies that rtems_regulator_send() returns an + * error when the message length is 0. + */ +static void test_regulator_send_length_is_zero(void) +{ + rtems_status_code sc; + rtems_regulator_instance regulator; + void *buffer; + size_t length; + + buffer = &length; + length = 0; + + sc = rtems_regulator_send(®ulator, buffer, length); + rtems_test_assert(sc == RTEMS_INVALID_NUMBER); +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_send uninitialized regulator error + * + * This unit test verifies that rtems_regulator_send() returns an + * error when the regulator argument is uninitialized. + */ +static void test_regulator_send_uninitialized_regulator(void) +{ + rtems_status_code sc; + rtems_regulator_instance regulator; + void *buffer; + size_t length; + + buffer = &length; + length = sizeof(size_t); + + (void) memset(®ulator, 0, sizeof(regulator)); + + sc = rtems_regulator_send(®ulator, buffer, length); + rtems_test_assert(sc == RTEMS_INCORRECT_STATE); +} + +/** + * @ingroup RegulatorTests + * @brief Verify Cannot Delete with Message Outstanding + * + * This unit test verifies that when the regulator is successfully + * initialized, that it cannot be deleted with an undelivered message. + * It also verifies some basic statistics are working. + */ +static void test_regulator_cannot_delete_with_outstanding(void) +{ + rtems_status_code sc; + rtems_regulator_instance *regulator; + char message[MAXIMUM_MESSAGE_LENGTH]; + void *buffer; + size_t length; + int match; + rtems_regulator_attributes attributes = { + .deliverer = test_regulator_deliverer_logger, + .deliverer_context = &deliverer_logger_context, + .maximum_message_size = 16, + .maximum_messages = 10, + .delivery_thread_priority = 16, + .delivery_thread_stack_size = 0, + .delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(250), + .maximum_to_dequeue_per_period = 3 + }; + rtems_regulator_statistics stats; + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(regulator != NULL); + + deliverer_logger_context.regulator = regulator; + + delivered_messages_reset(); + + // Ensure statistics show no buffers obtained or processed + sc = rtems_regulator_get_statistics(regulator, &stats); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(stats.obtained == 0); + rtems_test_assert(stats.released == 0); + rtems_test_assert(stats.delivered == 0); + rtems_test_assert(stats.period_statistics.count == 0); + rtems_test_assert(stats.period_statistics.missed_count == 0); + + // Obtain a buffer which should change the statistics + sc = rtems_regulator_obtain_buffer(regulator, &buffer); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(buffer != NULL); + + // Ensure statistics show one buffer obtained + sc = rtems_regulator_get_statistics(regulator, &stats); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(stats.obtained == 1); + rtems_test_assert(stats.released == 0); + rtems_test_assert(stats.delivered == 0); + rtems_test_assert(stats.period_statistics.count == 0); + rtems_test_assert(stats.period_statistics.missed_count == 0); + + + // Format and send the message -- statistics do not change + length = snprintf(message, MAXIMUM_MESSAGE_LENGTH, "message %d", 1024) + 1; + strcpy(buffer, message); + + sc = rtems_regulator_send(regulator, buffer, length); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + // Ensure statistics show one buffer obtained + sc = rtems_regulator_get_statistics(regulator, &stats); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(stats.obtained == 1); + rtems_test_assert(stats.released == 0); + rtems_test_assert(stats.delivered == 0); + rtems_test_assert(stats.period_statistics.count == 0); + rtems_test_assert(stats.period_statistics.missed_count == 0); + + // This is the actual failing case -- cannot delete w/outstanding + sc = rtems_regulator_delete(regulator, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_RESOURCE_IN_USE); + + // Now let the deliveries happen + sleep(1); + + // Ensure statistics show all buffers released + sc = rtems_regulator_get_statistics(regulator, &stats); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(stats.obtained == 1); + rtems_test_assert(stats.released == 1); + rtems_test_assert(stats.delivered == 1); + rtems_test_assert(stats.period_statistics.count != 0); + rtems_test_assert(stats.period_statistics.missed_count == 0); + + rtems_test_assert(delivered_message_count == 1); + match = strncmp( + delivered_messages[0].message, + message, + MAXIMUM_MESSAGE_LENGTH + ); + rtems_test_assert(match == 0); + + sc = rtems_regulator_delete(regulator, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + deliverer_logger_context.regulator = NULL; +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_send and output thread delivers message + * + * This unit test verifies that when the regulator is + * successfully initialized and used as expected, a message sent via + * rtems_regulator_send() is delivered as expected. + */ +static void test_regulator_send_one_message_OK(void) +{ + rtems_status_code sc; + rtems_regulator_instance *regulator; + char message[MAXIMUM_MESSAGE_LENGTH]; + void *buffer; + size_t length; + int match; + rtems_regulator_attributes attributes = { + .deliverer = test_regulator_deliverer_logger, + .deliverer_context = &deliverer_logger_context, + .maximum_message_size = 16, + .maximum_messages = 10, + .delivery_thread_priority = 16, + .delivery_thread_stack_size = 0, + .delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(250), + .maximum_to_dequeue_per_period = 3 + }; + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(regulator != NULL); + + deliverer_logger_context.regulator = regulator; + + delivered_messages_reset(); + + sc = rtems_regulator_obtain_buffer(regulator, &buffer); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(buffer != NULL); + + length = snprintf(message, MAXIMUM_MESSAGE_LENGTH, "message %d", 1024) + 1; + strcpy(buffer, message); + + sc = rtems_regulator_send(regulator, buffer, length); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sleep(1); + + rtems_test_assert(delivered_message_count == 1); + match = strncmp( + delivered_messages[0].message, + message, + MAXIMUM_MESSAGE_LENGTH + ); + rtems_test_assert(match == 0); + + sc = rtems_regulator_delete(regulator, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + deliverer_logger_context.regulator = NULL; +} + +/** + * @ingroup RegulatorTests + * @brief Verify rtems_regulator_send and output thread delivers messages + * + * This unit test verifies that when the regulator is successfully initialized + * and used as expected, and multiple messages are sent via rtems_regulator_send() + * that they are delivered as expected. + */ +#include <stdio.h> +static void test_regulator_send_multiple_messages_OK(void) +{ + rtems_status_code sc; + rtems_regulator_instance *regulator; + char message[MAXIMUM_MESSAGE_LENGTH]; + void *buffer; + size_t length; + int match; + int i; + time_t base_time; + time_t tmp_time; + rtems_interval base_ticks; + rtems_interval ticks; + rtems_interval ticks_per_second; + + rtems_regulator_attributes attributes = { + .deliverer = test_regulator_deliverer_logger, + .deliverer_context = &deliverer_logger_context, + .maximum_message_size = MAXIMUM_MESSAGE_LENGTH, + .maximum_messages = 10, + .delivery_thread_priority = 16, + .delivery_thread_stack_size = 0, + .delivery_thread_period = RTEMS_MILLISECONDS_TO_TICKS(1000), + .maximum_to_dequeue_per_period = 2 + }; + + delivered_messages_reset(); + + sc = rtems_regulator_create(&attributes, ®ulator); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(regulator != NULL); + + deliverer_logger_context.regulator = regulator; + + /* + * Ensure the messages are sent on a second boundary to ensure the + * output thread will process them as expected. + */ + tmp_time = time(NULL); + do { + base_time = time(NULL); + } while (tmp_time == base_time); + + /** + * Send five messages as a burst which will need to be smoothly sent at + * the configured rate. + */ + for (i=1 ; i <= 5 ; i++) { + sc = rtems_regulator_obtain_buffer(regulator, &buffer); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert(buffer != NULL); + + length = snprintf(message, MAXIMUM_MESSAGE_LENGTH, "message %d", i); + strcpy(buffer, message); + + sc = rtems_regulator_send(regulator, buffer, length); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + } + + /* + * Let the output thread executed and deliver the messages. + */ + sleep(5); + + /** + * Ensure the five messages were delivered as follows: + * + * - deliver all 5 + * - contents are "message N" where N is 1 to 5 + * - message 1 and 2 delivered during the first second + * - message 3 and 4 delivered during the second second + * - message 5 delivered during the third second + * - no further messages delivered + */ + + rtems_test_assert(delivered_message_count == 5); + + for (i=0 ; i < 5 ; i++) { + (void) snprintf(message, MAXIMUM_MESSAGE_LENGTH, "message %d", i+1); +// printf("%d %s\n", i, delivered_messages[i].message); + match = strncmp( + delivered_messages[i].message, + message, + MAXIMUM_MESSAGE_LENGTH + ); + rtems_test_assert(match == 0); + } + + /** + * Verify that messages were delivered in the proper groups. Check that + * the delivery time matches expectations. + */ + rtems_test_assert(delivered_messages[0].processed == delivered_messages[1].processed); + rtems_test_assert(delivered_messages[1].processed != delivered_messages[2].processed); + rtems_test_assert(delivered_messages[2].processed == delivered_messages[3].processed); + rtems_test_assert(delivered_messages[3].processed != delivered_messages[4].processed); + + /** + * Verify that the message groups were properly spaced temporally. They + * should be one second apart. + */ + ticks_per_second = rtems_clock_get_ticks_per_second(); + + base_ticks = delivered_messages[1].processed; + ticks = delivered_messages[2].processed; + rtems_test_assert(ticks_per_second == ticks - base_ticks); + + base_ticks = delivered_messages[3].processed; + ticks = delivered_messages[4].processed; + rtems_test_assert(ticks_per_second == ticks - base_ticks); + + sc = rtems_regulator_delete(regulator, FIVE_SECONDS); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + deliverer_logger_context.regulator = NULL; +} + +/* Necessary prototype */ +rtems_task test_regulator(rtems_task_argument); + +/** + * @ingroup RegulatorTestshttps://devel.rtems.org/milestone/6.1 + * @brief Test entry task which invokes test cases + */ +rtems_task test_regulator(rtems_task_argument arg) +{ + (void) arg; + + TEST_BEGIN(); + + malloc_trigger_reset(); + + test_regulator_create_max_dequeue_zero(); + test_regulator_create_null_attributes(); + test_regulator_create_null_regulator(); + test_regulator_create_deliverer_is_null(); + test_regulator_create_maximum_messages_is_zero(); + test_regulator_create_maximum_message_size_is_zero(); + test_regulator_create_maximum_to_dequeue_per_period_is_zero(); + test_regulator_create_malloc_regulator_fails(); + test_regulator_create_malloc_buffers_fails(); + test_regulator_create_delivery_thread_priority_is_zero(); + test_regulator_create_partition_create_fails(); + test_regulator_create_message_queue_create_fails(); + test_regulator_create_task_create_fails(); + test_regulator_create_rate_monotonic_create_fails(); + + test_regulator_delete_null_regulator(); + test_regulator_delete_uninitialized_regulator(); + test_regulator_delete_OK(); + + test_regulator_obtain_buffer_null_regulator(); + test_regulator_obtain_buffer_uninitialized_regulator(); + test_regulator_obtain_buffer_OK(); + + test_regulator_release_buffer_null_regulator(); + test_regulator_release_buffer_uninitialized_regulator(); + test_regulator_release_buffer_OK(); + + test_regulator_send_null_regulator(); + test_regulator_send_null_message(); + test_regulator_send_length_is_zero(); + test_regulator_send_uninitialized_regulator(); + + test_regulator_send_one_message_OK(); + test_regulator_cannot_delete_with_outstanding(); + + test_regulator_send_multiple_messages_OK(); + + TEST_END(); + + rtems_test_exit(0); +} diff --git a/testsuites/libtests/regulator01/regulator01.doc b/testsuites/libtests/regulator01/regulator01.doc new file mode 100644 index 0000000000..ff4e8005ec --- /dev/null +++ b/testsuites/libtests/regulator01/regulator01.doc @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: BSD-2-Clause + +# Copyright (c) 2023 OAR Corporation +# +# 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: regulator01 + +directives: + + rtems_regulator_create + + rtems_regulator_delete + + rtems_regulator_obtain_buffer + + rtems_regulator_release_buffer + + rtems_regulator_send + +concepts + + Verify rtems_regulator_create() maximum_to_dequeue_per_period + + Verify rtems_regulator_create() NULL attributes error + + Verify rtems_regulator_create NULL regulator error + + Verify rtems_regulator_create deliverer is NULL + + Verify rtems_regulator_create maximum_messages is 0 error + + Verify rtems_regulator_create maximum_message_size is 0 error + + Verify rtems_regulator_create maximum_to_dequeue_per_period is 0 error + + Verify rtems_regulator_create returns error on failure to allocate regulator + + Verify rtems_regulator_create returns error on failure to allocate buffers + + Verify rtems_regulator_create and delete work + + Verify rtems_regulator_create rtems_partition_create error + + Verify rtems_regulator_create rtems_message_queue_create error + + Verify rtems_regulator_create rtems_task_create error + + Verify Regulator Output Thread Handles Error on Period Create + + Verify rtems_regulator_delete NULL regulator error + + Verify rtems_regulator_delete uninitialized regulator error + + Verify rtems_regulator_delete successful case + + Verify rtems_regulator_obtain_buffer NULL regulator error + + Verify rtems_regulator_obtain_buffer uninitialized regulator error + + Verify rtems_regulator_obtain_buffer successful case + + Verify rtems_regulator_release_buffer NULL regulator error + + Verify rtems_regulator_release_buffer uninitialized regulator error + + Verify rtems_regulator_release_buffer successful case + + Verify rtems_regulator_send NULL regulator error + + Verify rtems_regulator_send NULL message error + + Verify rtems_regulator_send zero length message error + + Verify rtems_regulator_send uninitialized regulator error + + Verify rtems_regulator_send and output thread delivers message + + Verify rtems_regulator_send and cannot delete with outstanding messages diff --git a/testsuites/libtests/regulator01/rtems_config.c b/testsuites/libtests/regulator01/rtems_config.c new file mode 100644 index 0000000000..ca96e1b1dd --- /dev/null +++ b/testsuites/libtests/regulator01/rtems_config.c @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @brief RTEMS Configuration for regulator tests + */ + +/* + * 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. + */ + + +#include <rtems.h> + +rtems_task test_regulator(rtems_task_argument); + +#include <bsp.h> /* for device driver prototypes */ + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE +#define CONFIGURE_INIT_TASK_ENTRY_POINT test_regulator +#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT + +/* Use hard limits to make it easier to trip object creation errors */ +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_PARTITIONS 1 +#define CONFIGURE_MAXIMUM_PERIODS 1 + +#define CONFIGURE_UNIFIED_WORK_AREAS +#define CONFIGURE_MINIMUM_TASK_STACK_SIZE (8 * 1024) + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> diff --git a/testsuites/libtests/rtmonuse/getall.c b/testsuites/libtests/rtmonuse/getall.c index e9272f7b53..1965bd7c28 100644 --- a/testsuites/libtests/rtmonuse/getall.c +++ b/testsuites/libtests/rtmonuse/getall.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Get_all_counters * * This routine allows TA5 to atomically obtain the iteration counters. @@ -9,9 +11,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/rtmonuse/init.c b/testsuites/libtests/rtmonuse/init.c index a3f2ee10ca..bf7315e0d3 100644 --- a/testsuites/libtests/rtmonuse/init.c +++ b/testsuites/libtests/rtmonuse/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Init * * This routine is the initialization task for this test program. @@ -14,9 +16,26 @@ * COPYRIGHT (c) 1989-2007. * 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/libtests/rtmonuse/system.h b/testsuites/libtests/rtmonuse/system.h index 7f344a47e3..a83a2a3a0d 100644 --- a/testsuites/libtests/rtmonuse/system.h +++ b/testsuites/libtests/rtmonuse/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <tmacros.h> diff --git a/testsuites/libtests/rtmonuse/task1.c b/testsuites/libtests/rtmonuse/task1.c index b0db7fe4be..2d4baeb625 100644 --- a/testsuites/libtests/rtmonuse/task1.c +++ b/testsuites/libtests/rtmonuse/task1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Task_1_through_5 * * This routine serves as a test task for the period capabilities of the @@ -11,9 +13,26 @@ * COPYRIGHT (c) 1989-2007. * 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/libtests/sha/init.c b/testsuites/libtests/sha/init.c index 78e09a71ed..7d8c4ada3e 100644 --- a/testsuites/libtests/sha/init.c +++ b/testsuites/libtests/sha/init.c @@ -1,28 +1,46 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2014 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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 <sha224.h> #include <sha256.h> +#include <sha384.h> #include <sha512.h> +#include <sha512t.h> #include <stdio.h> #include <string.h> #include "tmacros.h" +#include <rtems/stackchk.h> + const char rtems_test_name[] = "SHA"; static const char *const test_vectors[] = { @@ -34,7 +52,32 @@ static const char *const test_vectors[] = { }; static const unsigned char -test_sha256_results[RTEMS_ARRAY_SIZE(test_vectors)][32] = { +test_sha224_results[RTEMS_ARRAY_SIZE(test_vectors)][SHA224_DIGEST_LENGTH] = { + { + 0x23, 0x09, 0x7d, 0x22, 0x34, 0x05, 0xd8, 0x22, + 0x86, 0x42, 0xa4, 0x77, 0xbd, 0xa2, 0x55, 0xb3, + 0x2a, 0xad, 0xbc, 0xe4, 0xbd, 0xa0, 0xb3, 0xf7, + 0xe3, 0x6c, 0x9d, 0xa7 + }, { + 0xd1, 0x4a, 0x02, 0x8c, 0x2a, 0x3a, 0x2b, 0xc9, + 0x47, 0x61, 0x02, 0xbb, 0x28, 0x82, 0x34, 0xc4, + 0x15, 0xa2, 0xb0, 0x1f, 0x82, 0x8e, 0xa6, 0x2a, + 0xc5, 0xb3, 0xe4, 0x2f + }, { + 0x75, 0x38, 0x8b, 0x16, 0x51, 0x27, 0x76, 0xcc, + 0x5d, 0xba, 0x5d, 0xa1, 0xfd, 0x89, 0x01, 0x50, + 0xb0, 0xc6, 0x45, 0x5c, 0xb4, 0xf5, 0x8b, 0x19, + 0x52, 0x52, 0x25, 0x25 + }, { + 0xc9, 0x7c, 0xa9, 0xa5, 0x59, 0x85, 0x0c, 0xe9, + 0x7a, 0x04, 0xa9, 0x6d, 0xef, 0x6d, 0x99, 0xa9, + 0xe0, 0xe0, 0xe2, 0xab, 0x14, 0xe6, 0xb8, 0xdf, + 0x26, 0x5f, 0xc0, 0xb3 + } +}; + +static const unsigned char +test_sha256_results[RTEMS_ARRAY_SIZE(test_vectors)][SHA256_DIGEST_LENGTH] = { { 0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23, @@ -59,7 +102,40 @@ test_sha256_results[RTEMS_ARRAY_SIZE(test_vectors)][32] = { }; static const unsigned char -test_sha512_results[RTEMS_ARRAY_SIZE(test_vectors)][64] = { +test_sha384_results[RTEMS_ARRAY_SIZE(test_vectors)][SHA384_DIGEST_LENGTH] = { + { + 0xcb, 0x00, 0x75, 0x3f, 0x45, 0xa3, 0x5e, 0x8b, + 0xb5, 0xa0, 0x3d, 0x69, 0x9a, 0xc6, 0x50, 0x07, + 0x27, 0x2c, 0x32, 0xab, 0x0e, 0xde, 0xd1, 0x63, + 0x1a, 0x8b, 0x60, 0x5a, 0x43, 0xff, 0x5b, 0xed, + 0x80, 0x86, 0x07, 0x2b, 0xa1, 0xe7, 0xcc, 0x23, + 0x58, 0xba, 0xec, 0xa1, 0x34, 0xc8, 0x25, 0xa7 + }, { + 0x38, 0xb0, 0x60, 0xa7, 0x51, 0xac, 0x96, 0x38, + 0x4c, 0xd9, 0x32, 0x7e, 0xb1, 0xb1, 0xe3, 0x6a, + 0x21, 0xfd, 0xb7, 0x11, 0x14, 0xbe, 0x07, 0x43, + 0x4c, 0x0c, 0xc7, 0xbf, 0x63, 0xf6, 0xe1, 0xda, + 0x27, 0x4e, 0xde, 0xbf, 0xe7, 0x6f, 0x65, 0xfb, + 0xd5, 0x1a, 0xd2, 0xf1, 0x48, 0x98, 0xb9, 0x5b + }, { + 0x33, 0x91, 0xfd, 0xdd, 0xfc, 0x8d, 0xc7, 0x39, + 0x37, 0x07, 0xa6, 0x5b, 0x1b, 0x47, 0x09, 0x39, + 0x7c, 0xf8, 0xb1, 0xd1, 0x62, 0xaf, 0x05, 0xab, + 0xfe, 0x8f, 0x45, 0x0d, 0xe5, 0xf3, 0x6b, 0xc6, + 0xb0, 0x45, 0x5a, 0x85, 0x20, 0xbc, 0x4e, 0x6f, + 0x5f, 0xe9, 0x5b, 0x1f, 0xe3, 0xc8, 0x45, 0x2b + }, { + 0x09, 0x33, 0x0c, 0x33, 0xf7, 0x11, 0x47, 0xe8, + 0x3d, 0x19, 0x2f, 0xc7, 0x82, 0xcd, 0x1b, 0x47, + 0x53, 0x11, 0x1b, 0x17, 0x3b, 0x3b, 0x05, 0xd2, + 0x2f, 0xa0, 0x80, 0x86, 0xe3, 0xb0, 0xf7, 0x12, + 0xfc, 0xc7, 0xc7, 0x1a, 0x55, 0x7e, 0x2d, 0xb9, + 0x66, 0xc3, 0xe9, 0xfa, 0x91, 0x74, 0x60, 0x39 + } +}; + +static const unsigned char +test_sha512_results[RTEMS_ARRAY_SIZE(test_vectors)][SHA512_DIGEST_LENGTH] = { { 0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba, 0xcc, 0x41, 0x73, 0x49, 0xae, 0x20, 0x41, 0x31, @@ -99,6 +175,56 @@ test_sha512_results[RTEMS_ARRAY_SIZE(test_vectors)][64] = { } }; +static const unsigned char test_sha512_224_results +[RTEMS_ARRAY_SIZE(test_vectors)][SHA512_224_DIGEST_LENGTH] = { + { + 0x46, 0x34, 0x27, 0x0f, 0x70, 0x7b, 0x6a, 0x54, + 0xda, 0xae, 0x75, 0x30, 0x46, 0x08, 0x42, 0xe2, + 0x0e, 0x37, 0xed, 0x26, 0x5c, 0xee, 0xe9, 0xa4, + 0x3e, 0x89, 0x24, 0xaa + }, { + 0x6e, 0xd0, 0xdd, 0x02, 0x80, 0x6f, 0xa8, 0x9e, + 0x25, 0xde, 0x06, 0x0c, 0x19, 0xd3, 0xac, 0x86, + 0xca, 0xbb, 0x87, 0xd6, 0xa0, 0xdd, 0xd0, 0x5c, + 0x33, 0x3b, 0x84, 0xf4 + }, { + 0xe5, 0x30, 0x2d, 0x6d, 0x54, 0xbb, 0x24, 0x22, + 0x75, 0xd1, 0xe7, 0x62, 0x2d, 0x68, 0xdf, 0x6e, + 0xb0, 0x2d, 0xed, 0xd1, 0x3f, 0x56, 0x4c, 0x13, + 0xdb, 0xda, 0x21, 0x74 + }, { + 0x23, 0xfe, 0xc5, 0xbb, 0x94, 0xd6, 0x0b, 0x23, + 0x30, 0x81, 0x92, 0x64, 0x0b, 0x0c, 0x45, 0x33, + 0x35, 0xd6, 0x64, 0x73, 0x4f, 0xe4, 0x0e, 0x72, + 0x68, 0x67, 0x4a, 0xf9 + } +}; + +static const unsigned char test_sha512_256_results +[RTEMS_ARRAY_SIZE(test_vectors)][SHA512_256_DIGEST_LENGTH] = { + { + 0x53, 0x04, 0x8e, 0x26, 0x81, 0x94, 0x1e, 0xf9, + 0x9b, 0x2e, 0x29, 0xb7, 0x6b, 0x4c, 0x7d, 0xab, + 0xe4, 0xc2, 0xd0, 0xc6, 0x34, 0xfc, 0x6d, 0x46, + 0xe0, 0xe2, 0xf1, 0x31, 0x07, 0xe7, 0xaf, 0x23 + }, { + 0xc6, 0x72, 0xb8, 0xd1, 0xef, 0x56, 0xed, 0x28, + 0xab, 0x87, 0xc3, 0x62, 0x2c, 0x51, 0x14, 0x06, + 0x9b, 0xdd, 0x3a, 0xd7, 0xb8, 0xf9, 0x73, 0x74, + 0x98, 0xd0, 0xc0, 0x1e, 0xce, 0xf0, 0x96, 0x7a + }, { + 0xbd, 0xe8, 0xe1, 0xf9, 0xf1, 0x9b, 0xb9, 0xfd, + 0x34, 0x06, 0xc9, 0x0e, 0xc6, 0xbc, 0x47, 0xbd, + 0x36, 0xd8, 0xad, 0xa9, 0xf1, 0x18, 0x80, 0xdb, + 0xc8, 0xa2, 0x2a, 0x70, 0x78, 0xb6, 0xa4, 0x61 + }, { + 0x39, 0x28, 0xe1, 0x84, 0xfb, 0x86, 0x90, 0xf8, + 0x40, 0xda, 0x39, 0x88, 0x12, 0x1d, 0x31, 0xbe, + 0x65, 0xcb, 0x9d, 0x3e, 0xf8, 0x3e, 0xe6, 0x14, + 0x6f, 0xea, 0xc8, 0x61, 0xe1, 0x9b, 0x56, 0x3a + } +}; + static void print_result(const unsigned char *r, size_t n) { size_t i; @@ -118,6 +244,29 @@ static void print_result(const unsigned char *r, size_t n) printf("\n"); } +static void test_sha224(void) +{ + size_t i; + + printf("test SHA224\n"); + + for (i = 0; i < RTEMS_ARRAY_SIZE(test_vectors); ++i) { + SHA224_CTX ctx; + unsigned char r[SHA224_DIGEST_LENGTH]; + const char *s = test_vectors[i]; + + SHA224_Init(&ctx); + SHA224_Update(&ctx, s, strlen(s)); + SHA224_Final(r, &ctx); + + print_result(&r[0], sizeof(r)); + + rtems_test_assert( + memcmp(&r[0], &test_sha224_results[i][0], sizeof(r)) == 0 + ); + } +} + static void test_sha256(void) { size_t i; @@ -126,7 +275,7 @@ static void test_sha256(void) for (i = 0; i < RTEMS_ARRAY_SIZE(test_vectors); ++i) { SHA256_CTX ctx; - unsigned char r[32]; + unsigned char r[SHA256_DIGEST_LENGTH]; const char *s = test_vectors[i]; SHA256_Init(&ctx); @@ -141,6 +290,29 @@ static void test_sha256(void) } } +static void test_sha384(void) +{ + size_t i; + + printf("test SHA384\n"); + + for (i = 0; i < RTEMS_ARRAY_SIZE(test_vectors); ++i) { + SHA384_CTX ctx; + unsigned char r[SHA384_DIGEST_LENGTH]; + const char *s = test_vectors[i]; + + SHA384_Init(&ctx); + SHA384_Update(&ctx, s, strlen(s)); + SHA384_Final(r, &ctx); + + print_result(&r[0], sizeof(r)); + + rtems_test_assert( + memcmp(&r[0], &test_sha384_results[i][0], sizeof(r)) == 0 + ); + } +} + static void test_sha512(void) { size_t i; @@ -149,7 +321,7 @@ static void test_sha512(void) for (i = 0; i < RTEMS_ARRAY_SIZE(test_vectors); ++i) { SHA512_CTX ctx; - unsigned char r[64]; + unsigned char r[SHA512_DIGEST_LENGTH]; const char *s = test_vectors[i]; SHA512_Init(&ctx); @@ -164,12 +336,63 @@ static void test_sha512(void) } } +static void test_sha512_224(void) +{ + size_t i; + + printf("test SHA512-224\n"); + + for (i = 0; i < RTEMS_ARRAY_SIZE(test_vectors); ++i) { + SHA512_CTX ctx; + unsigned char r[SHA512_224_DIGEST_LENGTH]; + const char *s = test_vectors[i]; + + SHA512_224_Init(&ctx); + SHA512_224_Update(&ctx, s, strlen(s)); + SHA512_224_Final(r, &ctx); + + print_result(&r[0], sizeof(r)); + + rtems_test_assert( + memcmp(&r[0], &test_sha512_224_results[i][0], sizeof(r)) == 0 + ); + } +} + +static void test_sha512_256(void) +{ + size_t i; + + printf("test SHA512-256\n"); + + for (i = 0; i < RTEMS_ARRAY_SIZE(test_vectors); ++i) { + SHA512_CTX ctx; + unsigned char r[SHA512_256_DIGEST_LENGTH]; + const char *s = test_vectors[i]; + + SHA512_256_Init(&ctx); + SHA512_256_Update(&ctx, s, strlen(s)); + SHA512_256_Final(r, &ctx); + + print_result(&r[0], sizeof(r)); + + rtems_test_assert( + memcmp(&r[0], &test_sha512_256_results[i][0], sizeof(r)) == 0 + ); + } +} + static void Init(rtems_task_argument arg) { TEST_BEGIN(); + test_sha224(); test_sha256(); + test_sha384(); test_sha512(); + test_sha512_224(); + test_sha512_256(); + rtems_stack_checker_report_usage(); TEST_END(); rtems_test_exit(0); @@ -180,10 +403,18 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_STACK_CHECKER_ENABLED + #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION #define CONFIGURE_RTEMS_INIT_TASKS_TABLE +/* + * The SHA512_Update() function may need a lot of stack space if the compiler + * optimization is disabled. + */ +#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024) + #define CONFIGURE_INIT #include <rtems/confdefs.h> diff --git a/testsuites/libtests/shell01/init.c b/testsuites/libtests/shell01/init.c index a69bbc0cdb..83564d9937 100644 --- a/testsuites/libtests/shell01/init.c +++ b/testsuites/libtests/shell01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2014, 2019 embedded brains GmbH. All rights reserved. + * Copyright (C) 2014, 2019 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/sparsedisk01/init.c b/testsuites/libtests/sparsedisk01/init.c index abb1ee394b..5398bf98ce 100644 --- a/testsuites/libtests/sparsedisk01/init.c +++ b/testsuites/libtests/sparsedisk01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/spi01/init.c b/testsuites/libtests/spi01/init.c index a32f34b5c0..7b68d0f76a 100644 --- a/testsuites/libtests/spi01/init.c +++ b/testsuites/libtests/spi01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2016 embedded brains GmbH. All rights reserved. + * Copyright (c) 2016 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/stackchk/blow.c b/testsuites/libtests/stackchk/blow.c index 3b8bb7842f..e394d7233d 100644 --- a/testsuites/libtests/stackchk/blow.c +++ b/testsuites/libtests/stackchk/blow.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* task1.c * * This set of three tasks do some simple task switching for about @@ -6,9 +8,26 @@ * 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/libtests/stackchk/init.c b/testsuites/libtests/stackchk/init.c index da22a7ab50..b6f57f80fe 100644 --- a/testsuites/libtests/stackchk/init.c +++ b/testsuites/libtests/stackchk/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Init * * This routine is the initialization task for this test program. @@ -14,9 +16,26 @@ * COPYRIGHT (c) 1989-1999. * 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/libtests/stackchk/stackchk.doc b/testsuites/libtests/stackchk/stackchk.doc index febe9e3ac6..ebc01d4f96 100644 --- a/testsuites/libtests/stackchk/stackchk.doc +++ b/testsuites/libtests/stackchk/stackchk.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 2014. # On-Line Applications Research Corporation (OAR). # Cynthia Rempel <cynthia@rtems.org> -# 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. diff --git a/testsuites/libtests/stackchk/system.h b/testsuites/libtests/stackchk/system.h index cdadb78c69..8f984e07d1 100644 --- a/testsuites/libtests/stackchk/system.h +++ b/testsuites/libtests/stackchk/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <tmacros.h> diff --git a/testsuites/libtests/stackchk/task1.c b/testsuites/libtests/stackchk/task1.c index 7a9f488ff0..8c495c3f69 100644 --- a/testsuites/libtests/stackchk/task1.c +++ b/testsuites/libtests/stackchk/task1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* task1.c * * This set of three tasks do some simple task switching for about @@ -6,9 +8,26 @@ * 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 @@ -25,7 +44,7 @@ rtems_task Task_1_through_3( rtems_time_of_day time; rtems_status_code status; - status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); + status = rtems_task_ident( RTEMS_WHO_AM_I, RTEMS_SEARCH_ALL_NODES, &tid ); directive_failed( status, "rtems_task_ident" ); while( FOREVER ) { diff --git a/testsuites/libtests/stackchk01/init.c b/testsuites/libtests/stackchk01/init.c index 8e907e6d48..b87b6baa2d 100644 --- a/testsuites/libtests/stackchk01/init.c +++ b/testsuites/libtests/stackchk01/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 @@ -16,14 +35,18 @@ const char rtems_test_name[] = "STACKCHK 1"; -/* forward declarations to avoid warnings */ -rtems_task Init(rtems_task_argument argument); +static void stack_visitor( const rtems_stack_checker_info *info, void *arg ) +{ + if ( rtems_object_id_get_api( info->id ) == 1 ) { + *(uintptr_t *) arg = info->used; + } +} -rtems_task Init( - rtems_task_argument argument -) +static rtems_task Init( rtems_task_argument argument ) { - bool blown; + bool blown; + uintptr_t used; + uintptr_t limit; TEST_BEGIN(); @@ -31,14 +54,26 @@ rtems_task Init( blown = rtems_stack_checker_is_blown(); rtems_test_assert(!blown); + rtems_task_wake_after( 2 ); + used = 0; + rtems_stack_checker_iterate( stack_visitor, &used ); + limit = CPU_STACK_MINIMUM_SIZE / 4; + printf( + "check used IDLE stack size: 0 < %" PRIuPTR " <= %" PRIuPTR "\n", + used, + limit + ); + rtems_test_assert( used > 0 ); + rtems_test_assert( used <= limit ); + TEST_END(); rtems_test_exit(0); } /* configuration information */ +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #define CONFIGURE_MAXIMUM_TASKS 1 #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION diff --git a/testsuites/libtests/stackchk01/stackchk01.doc b/testsuites/libtests/stackchk01/stackchk01.doc index c4dea4d9b6..cbb9fb62f9 100644 --- a/testsuites/libtests/stackchk01/stackchk01.doc +++ b/testsuites/libtests/stackchk01/stackchk01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 1989-1999. # 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. @@ -11,9 +30,17 @@ This file describes the directives and concepts tested by this test set. test set name: stackchk01 directives: - rtems_stack_checker_is_blown + +* CPU_STACK_MINIMUM_SIZE + +* rtems_stack_checker_is_blown + +* rtems_stack_checker_iterate concepts: -+ ensure that dynamic checks for a blown stack work both when the stack +* Ensure that dynamic checks for a blown stack work both when the stack is not blown and when it is. + +* Ensure that the CPU_STACK_MINIMUM_SIZE is suffiently larger than the stack + usage in simple applications. diff --git a/testsuites/libtests/stackchk02/init.c b/testsuites/libtests/stackchk02/init.c new file mode 100644 index 0000000000..0904e37c68 --- /dev/null +++ b/testsuites/libtests/stackchk02/init.c @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup libtests + */ + +/* + * 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 + +#define CONFIGURE_INIT + +#include <tmacros.h> + +#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3) + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#include <rtems/confdefs.h> + +#include <rtems/stackchk.h> + +const char rtems_test_name[] = "STACKCHK02"; + +rtems_task Init( + rtems_task_argument argument +) +{ + TEST_BEGIN(); + + rtems_stack_checker_report_usage(); + + TEST_END(); + rtems_test_exit( 0 ); +} diff --git a/testsuites/libtests/stackchk02/stackchk02.doc b/testsuites/libtests/stackchk02/stackchk02.doc new file mode 100644 index 0000000000..e2fca9d890 --- /dev/null +++ b/testsuites/libtests/stackchk02/stackchk02.doc @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: BSD-2-Clause + +# 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. +# +This file describes the directives and concepts tested by this test set. + +test set name: stackchk02 + +directives: + + rtems_stack_checker_report_usage + +concepts: + + This task verifies that the stack checker will not perform bad + accesses when not properly enabled. diff --git a/testsuites/libtests/stackchk02/stackchk02.scn b/testsuites/libtests/stackchk02/stackchk02.scn new file mode 100644 index 0000000000..bb2b782490 --- /dev/null +++ b/testsuites/libtests/stackchk02/stackchk02.scn @@ -0,0 +1,7 @@ +*** TEST STACKCHK02 *** + STACK USAGE BY THREAD +ID NAME LOW HIGH CURRENT AVAIL USED +0x09010001 IDLE 0x10104940 0x1010713f 0x10107140 10224 N/A +0x0a010001 UI1 0x10109950 0x1010c14f 0x1010c150 10224 N/A + +*** END OF TEST STACKCHK02 *** diff --git a/testsuites/libtests/stringto01/init.c b/testsuites/libtests/stringto01/init.c index 02a9360604..594ba3f08d 100644 --- a/testsuites/libtests/stringto01/init.c +++ b/testsuites/libtests/stringto01/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/libtests/stringto01/stringto01.doc b/testsuites/libtests/stringto01/stringto01.doc index 88e0b8b7eb..590d4b8634 100644 --- a/testsuites/libtests/stringto01/stringto01.doc +++ b/testsuites/libtests/stringto01/stringto01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # 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. # This file describes the directives and concepts tested by this test set. diff --git a/testsuites/libtests/stringto01/stringto_test_template.h b/testsuites/libtests/stringto01/stringto_test_template.h index 1309b4bda4..44e6c5cff1 100644 --- a/testsuites/libtests/stringto01/stringto_test_template.h +++ b/testsuites/libtests/stringto01/stringto_test_template.h @@ -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. */ #if defined(STRING_TO_POINTER) diff --git a/testsuites/libtests/syscall01/init.c b/testsuites/libtests/syscall01/init.c deleted file mode 100644 index 788a293274..0000000000 --- a/testsuites/libtests/syscall01/init.c +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (c) 2012-2015 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "tmacros.h" - -#include <sys/select.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <netinet/in.h> -#include <errno.h> -#include <fcntl.h> -#include <unistd.h> - -#include <rtems/libio.h> -#include <rtems/rtems_bsdnet.h> - -const char rtems_test_name[] = "SYSCALL 1"; - -static const char open_driver_path [] = "/dev/open_driver"; - -struct rtems_bsdnet_config rtems_bsdnet_config; - -typedef struct { - rtems_id main_task; - rtems_id close_task; - int fd; -} test_context; - -static test_context test_instance; - -static void test_sync(void) -{ - int rv; - char buf [1]; - ssize_t n; - int fd; - - fd = open(open_driver_path, O_RDWR); - rtems_test_assert(fd >= 0); - - errno = 0; - n = send(fd, buf, sizeof(buf), 0); - rtems_test_assert(n == -1); - rtems_test_assert(errno == ENOTSOCK); - - errno = 0; - n = recv(fd, buf, sizeof(buf), 0); - rtems_test_assert(n == -1); - rtems_test_assert(errno == ENOTSOCK); - - rv = close(fd); - rtems_test_assert(rv == 0); - - fd = socket(PF_INET, SOCK_DGRAM, 0); - rtems_test_assert(fd >= 0); - - errno = 0; - rv = fsync(fd); - rtems_test_assert(rv == -1); - rtems_test_assert(errno == EINVAL); - - errno = 0; - rv = fdatasync(fd); - rtems_test_assert(rv == -1); - rtems_test_assert(errno == EINVAL); - - rv = close(fd); - rtems_test_assert(rv == 0); -} - -static void close_task(rtems_task_argument arg) -{ - test_context *ctx = (test_context *) arg; - - while (true) { - rtems_status_code sc; - int rv; - - sc = rtems_event_transient_receive(RTEMS_WAIT, RTEMS_NO_TIMEOUT); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - - rv = close(ctx->fd); - rtems_test_assert(rv == 0); - - sc = rtems_event_transient_send(ctx->main_task); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - } -} - -static void request_close(test_context *ctx) -{ - rtems_status_code sc; - - sc = rtems_event_transient_send(ctx->close_task); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); -} - -static void wait_for_close_task(void) -{ - rtems_status_code sc; - - sc = rtems_event_transient_receive(RTEMS_WAIT, RTEMS_NO_TIMEOUT); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); -} - -static void test_accept_and_close(test_context *ctx) -{ - int rv; - int fd; - struct sockaddr_in addr; - socklen_t addrlen = sizeof(addr); - - ctx->fd = socket(PF_INET, SOCK_STREAM, 0); - rtems_test_assert(ctx->fd >= 0); - - rv = listen(ctx->fd, 1); - rtems_test_assert(rv == 0); - - request_close(ctx); - - errno = 0; - fd = accept(ctx->fd, (struct sockaddr *) &addr, &addrlen); - rtems_test_assert(fd == -1); - rtems_test_assert(errno == ENXIO); - - errno = 0; - fd = accept(ctx->fd, (struct sockaddr *) &addr, &addrlen); - rtems_test_assert(fd == -1); - rtems_test_assert(errno == EBADF); - - wait_for_close_task(); -} - -static void test_connect_and_close(test_context *ctx) -{ - int rv; - struct sockaddr_in addr; - socklen_t addrlen = sizeof(addr); - - ctx->fd = socket(PF_INET, SOCK_STREAM, 0); - rtems_test_assert(ctx->fd >= 0); - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(1234); - addr.sin_addr.s_addr = htonl(INADDR_ANY); - - request_close(ctx); - - errno = 0; - rv = connect(ctx->fd, (struct sockaddr *) &addr, addrlen); - rtems_test_assert(rv == -1); - rtems_test_assert(errno == ENXIO); - - errno = 0; - rv = connect(ctx->fd, (struct sockaddr *) &addr, addrlen); - rtems_test_assert(rv == -1); - rtems_test_assert(errno == EBADF); - - wait_for_close_task(); -} - -static void test_recv_and_close(test_context *ctx) -{ - int rv; - struct sockaddr_in addr; - socklen_t addrlen = sizeof(addr); - char buf[1]; - ssize_t n; - - ctx->fd = socket(PF_INET, SOCK_DGRAM, 0); - rtems_test_assert(ctx->fd >= 0); - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(1234); - addr.sin_addr.s_addr = htonl(INADDR_ANY); - - rv = bind(ctx->fd, (struct sockaddr *) &addr, addrlen); - rtems_test_assert(rv == 0); - - request_close(ctx); - - errno = 0; - n = recv(ctx->fd, &buf[0], sizeof(buf), 0); - rtems_test_assert(n == -1); - rtems_test_assert(errno == ENXIO); - - errno = 0; - n = recv(ctx->fd, &buf[0], sizeof(buf), 0); - rtems_test_assert(n == -1); - rtems_test_assert(errno == EBADF); - - wait_for_close_task(); -} - -static void test_select_and_close(test_context *ctx) -{ - int rv; - struct sockaddr_in addr; - socklen_t addrlen = sizeof(addr); - int nfds; - struct fd_set set; - - ctx->fd = socket(PF_INET, SOCK_DGRAM, 0); - rtems_test_assert(ctx->fd >= 0); - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(1234); - addr.sin_addr.s_addr = htonl(INADDR_ANY); - - rv = bind(ctx->fd, (struct sockaddr *) &addr, addrlen); - rtems_test_assert(rv == 0); - - nfds = ctx->fd + 1; - FD_ZERO(&set); - FD_SET(ctx->fd, &set); - - request_close(ctx); - - errno = 0; - rv = select(nfds, &set, NULL, NULL, NULL); - rtems_test_assert(rv == -1); - rtems_test_assert(errno == EBADF); - - wait_for_close_task(); -} - -static void Init(rtems_task_argument arg) -{ - test_context *ctx = &test_instance; - rtems_status_code sc; - int rv; - - TEST_BEGIN(); - - ctx->main_task = rtems_task_self(); - - sc = rtems_task_create( - rtems_build_name('C', 'L', 'O', 'S'), - 2, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &ctx->close_task - ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - - sc = rtems_task_start( - ctx->close_task, - close_task, - (rtems_task_argument) ctx - ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - - rv = rtems_bsdnet_initialize_network(); - rtems_test_assert(rv == 0); - - test_sync(); - test_accept_and_close(ctx); - test_connect_and_close(ctx); - test_recv_and_close(ctx); - test_select_and_close(ctx); - - sc = rtems_task_delete(ctx->close_task); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - - TEST_END(); - - rtems_test_exit(0); -} - -static rtems_device_driver open_driver_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *arg -) -{ - rtems_status_code sc = rtems_io_register_name(open_driver_path, major, 0); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - - return RTEMS_SUCCESSFUL; -} - -static rtems_device_driver open_driver_open( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *arg -) -{ - rtems_libio_open_close_args_t *oc = arg; - - oc->iop->data0 = 1; - oc->iop->data1 = (void *) 1; - - return RTEMS_SUCCESSFUL; -} - -#define OPEN_DRIVER { \ - .initialization_entry = open_driver_initialize, \ - .open_entry = open_driver_open \ -} - -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_EXTRA_DRIVERS OPEN_DRIVER - -#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 4 - -#define CONFIGURE_MAXIMUM_TASKS 3 - -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT - -#define CONFIGURE_INIT - -#include <rtems/confdefs.h> diff --git a/testsuites/libtests/syscall01/syscall01.doc b/testsuites/libtests/syscall01/syscall01.doc deleted file mode 100644 index d19eb3a812..0000000000 --- a/testsuites/libtests/syscall01/syscall01.doc +++ /dev/null @@ -1,24 +0,0 @@ -# COPYRIGHT (c) 2014. -# On-Line Applications Research Corporation (OAR). -# Cynthia Rempel <cynthia@rtems.org> -# 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. -# -This file describes the directives and concepts tested by this test set. - -test set name: stackchk - -directives: - + close - + open - + send - + recv - + rtems_bsdnet_initialize_network - + rtems_io_register_name - -concepts: - + initializes the bsd network driver - + registers an io driver - + opens a buffer, sends a buffer across the network, receives a buffer, - and closes the file
\ No newline at end of file diff --git a/testsuites/libtests/syscall01/syscall01.scn b/testsuites/libtests/syscall01/syscall01.scn deleted file mode 100644 index 598a0f419a..0000000000 --- a/testsuites/libtests/syscall01/syscall01.scn +++ /dev/null @@ -1,2 +0,0 @@ -*** TEST SYSCALL 1 *** -*** END OF TEST SYSCALL 1 *** diff --git a/testsuites/libtests/tar01/init.c b/testsuites/libtests/tar01/init.c index 4cad67a6ae..00a723656a 100644 --- a/testsuites/libtests/tar01/init.c +++ b/testsuites/libtests/tar01/init.c @@ -1,10 +1,56 @@ +/* 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. + */ + +/* + * Note on the used tar file: Generate the file on a system that supports + * symlinks with the following commands (tested on Linux - you might have to + * adapt on other systems): + * + * export WORK=some_work_directory + * rm -r ${WORK} + * mkdir -p ${WORK}/home/abc/def + * mkdir -p ${WORK}/home/dir + * cd ${WORK} + * echo "#! joel" > home/abc/def/test_script + * echo "ls -las /dev" >> home/abc/def/test_script + * chmod 755 home/abc/def/test_script + * echo "This is a test of loading an RTEMS filesystem from an" > home/test_file + * echo "initial tar image." >> home/test_file + * echo "Hello world" >> home/dir/file + * ln -s home/test_file symlink + * tar cf tar01.tar --format=ustar \ + * symlink \ + * home/test_file \ + * home/abc/def/test_script \ + * home/dir + * + * Note that "home/dir" is in the archive as separate directory. "home/abc" is + * only in the archive as a parent of the file "test_script". */ #ifdef HAVE_CONFIG_H @@ -95,6 +141,84 @@ void test_untar_from_memory(void) } +static void assert_file_content( + const char *name, + const char *expected_content, + ssize_t expected_size +) +{ + char buf[16]; + int fd; + int rd; + + fd = open(name, O_RDONLY); + rtems_test_assert( fd >= 0 ); + do { + rd = read(fd, buf, sizeof(buf)); + rtems_test_assert( rd >= 0 ); + if (rd > 0) { + rtems_test_assert( expected_size - rd >= 0 ); + rtems_test_assert( memcmp(buf, expected_content, rd) == 0 ); + expected_content += rd; + expected_size -= rd; + } + } while(rd > 0); + rtems_test_assert( expected_size == 0 ); + close(fd); +} + +static void assert_content_like_expected(void) +{ + const char *directories[] = { + "home", + "home/abc", + "home/abc/def", + "home/dir", + }; + const char *symlinks[] = { + "symlink", + }; + const struct { + const char *name; + const char *content; + } files[] = { + { + .name = "home/abc/def/test_script", + .content = "#! joel\nls -las /dev\n", + }, { + .name = "home/test_file", + .content = "This is a test of loading an RTEMS filesystem from an\n" + "initial tar image.\n", + }, { + .name = "home/dir/file", + .content = "Hello world\n", + } + }; + size_t i; + struct stat st; + + for(i = 0; i < RTEMS_ARRAY_SIZE(directories); ++i) { + lstat(directories[i], &st); + rtems_test_assert( S_ISDIR(st.st_mode) ); + } + + for(i = 0; i < RTEMS_ARRAY_SIZE(symlinks); ++i) { + lstat(symlinks[i], &st); + rtems_test_assert( S_ISLNK(st.st_mode) ); + } + + for(i = 0; i < RTEMS_ARRAY_SIZE(files); ++i) { + lstat(files[i].name, &st); + rtems_test_assert( S_ISREG(st.st_mode) ); + + assert_file_content( + files[i].name, + files[i].content, + strlen(files[i].content) + ); + } +} + void test_untar_from_file(void) { int fd; @@ -119,13 +243,105 @@ void test_untar_from_file(void) rv = chdir( "/dest" ); rtems_test_assert( rv == 0 ); - /* Untar it */ + /* Case 1: Untar it into empty directory */ rv = Untar_FromFile( "/test.tar" ); printf("Untaring from file - "); if (rv != UNTAR_SUCCESSFUL) { printf ("error: untar failed: %i\n", rv); exit(1); } + assert_content_like_expected(); + printf ("successful\n"); + + /* Case 2: Most files exist */ + rv = unlink("/dest/home/test_file"); + rtems_test_assert( rv == 0 ); + + rv = Untar_FromFile( "/test.tar" ); + printf("Untar from file into existing structure with one missing file - "); + if (rv != UNTAR_SUCCESSFUL) { + printf ("error: untar failed: %i\n", rv); + exit(1); + } + assert_content_like_expected(); + printf ("successful\n"); + + /* Case 3: An empty directory exists where a file should be */ + rv = unlink("/dest/home/test_file"); + rtems_test_assert( rv == 0 ); + rv = mkdir("/dest/home/test_file", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + rtems_test_assert( rv == 0 ); + + rv = Untar_FromFile( "/test.tar" ); + printf("Untar from file; overwrite empty directory with file - "); + if (rv != UNTAR_SUCCESSFUL) { + printf ("error: untar failed: %i\n", rv); + exit(1); + } + assert_content_like_expected(); + printf ("successful\n"); + + /* Case 4: A file exists where a parent directory should be created */ + rv = unlink("/dest/home/abc/def/test_script"); + rtems_test_assert( rv == 0 ); + rv = unlink("/dest/home/abc/def"); + rtems_test_assert( rv == 0 ); + rv = unlink("/dest/home/abc"); + rtems_test_assert( rv == 0 ); + fd = creat("/dest/home/abc", S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + rtems_test_assert( fd >= 0 ); + close(fd); + + rv = Untar_FromFile( "/test.tar" ); + printf("Untar from file; file exists where parent dir should be created - "); + if (rv != UNTAR_FAIL) { + printf ("error: untar didn't fail like expected: %i\n", rv); + exit(1); + } + printf ("expected fail\n"); + /* cleanup so that the next one works */ + rv = unlink("/dest/home/abc"); + rtems_test_assert( rv == 0 ); + + /* Case 5: A non-empty directory exists where a file should be created */ + rv = unlink("/dest/home/test_file"); + rtems_test_assert( rv == 0 ); + rv = mkdir("/dest/home/test_file", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + rtems_test_assert( rv == 0 ); + fd = creat("/dest/home/test_file/file", + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + rtems_test_assert( fd >= 0 ); + close(fd); + + rv = Untar_FromFile( "/test.tar" ); + printf("Untar from file; non-empty dir where file should be created - "); + if (rv != UNTAR_FAIL) { + printf ("error: untar didn't fail like expected: %i\n", rv); + exit(1); + } + printf ("expected fail\n"); + /* cleanup so that the next one works */ + rv = unlink("/dest/home/test_file/file"); + rtems_test_assert( rv == 0 ); + rv = unlink("/dest/home/test_file"); + rtems_test_assert( rv == 0 ); + + /* Case 6: A file exists where a directory is explicitly in the archive */ + rv = unlink("/dest/home/dir/file"); + rtems_test_assert( rv == 0 ); + rv = unlink("/dest/home/dir"); + rtems_test_assert( rv == 0 ); + fd = creat("/dest/home/dir", S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + rtems_test_assert( fd >= 0 ); + close(fd); + + rv = Untar_FromFile( "/test.tar" ); + printf("Untar from file; overwrite file with explicit directory - "); + if (rv != UNTAR_SUCCESSFUL) { + printf ("error: untar failed: %i\n", rv); + exit(1); + } + assert_content_like_expected(); printf ("successful\n"); /******************/ diff --git a/testsuites/libtests/tar01/tar01.doc b/testsuites/libtests/tar01/tar01.doc index 060f98a813..1530321f49 100644 --- a/testsuites/libtests/tar01/tar01.doc +++ b/testsuites/libtests/tar01/tar01.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. @@ -20,3 +39,4 @@ directives: concepts: + exercise these routines ++ check whether existing files are overwritten or not overwritten like expected diff --git a/testsuites/libtests/tar01/tar01.scn b/testsuites/libtests/tar01/tar01.scn index 68fa951881..dd72f9517b 100644 --- a/testsuites/libtests/tar01/tar01.scn +++ b/testsuites/libtests/tar01/tar01.scn @@ -1,9 +1,24 @@ -*** TAR01 TEST *** -Untaring from memory - successful +*** BEGIN OF TEST TAR 1 *** +*** TEST VERSION: 6.0.0.e1efb4eb8a9d6dd5f6f37dafc9feb0a9e6a888f1 +*** TEST STATE: EXPECTED_PASS +*** TEST BUILD: RTEMS_POSIX_API +*** TEST TOOLS: 10.3.1 20210409 (RTEMS 6, RSB ad54d1dd3cf8249d9d39deb1dd28b2f294df062d-modified, Newlib eb03ac1) +Untaring from memory - untar: memory at 0x11ece8 (10240) +untar: symlink: home/test_file -> symlink +untar: file: home/test_file (s:73,m:0644) +untar: file: home/abc/def/test_script (s:21,m:0755) +untar: dir: home/dir +untar: file: home/dir/file (s:12,m:0644) +successful ========= /home/test_file ========= (0)This is a test of loading an RTEMS filesystem from an initial tar image. +========= /home/abc/def/test_script ========= +(0)#! joel +ls -las /dev + + /home/abc/def/test_script: mode: 0755 want: 0755 ========= /symlink ========= (0)This is a test of loading an RTEMS filesystem from an initial tar image. @@ -11,35 +26,58 @@ initial tar image. Copy tar image to test.tar Untaring from file - successful +Untar from file into existing structure with one missing file - successful +Untar from file; overwrite empty directory with file - successful +Untar from file; file exists where parent dir should be created - expected fail +Untar from file; non-empty dir where file should be created - expected fail +Untar from file; overwrite file with explicit directory - successful ========= /dest/home/test_file ========= (0)This is a test of loading an RTEMS filesystem from an initial tar image. +========= /dest/home/abc/def/test_script ========= +(0)#! joel +ls -las /dev + + /dest/home/abc/def/test_script: mode: 0755 want: 0755 ========= /dest/symlink ========= (0)This is a test of loading an RTEMS filesystem from an initial tar image. -Untaring chunks from memory - untar: dir: home -untar: file: home/test_file (73) +Untaring chunks from memory - untar: symlink: home/test_file -> symlink +untar: file: home/test_file (s:73,m:0644) +untar: file: home/abc/def/test_script (s:21,m:0755) +untar: dir: home/dir +untar: file: home/dir/file (s:12,m:0644) successful ========= /dest2/home/test_file ========= (0)This is a test of loading an RTEMS filesystem from an initial tar image. +========= /dest2/home/abc/def/test_script ========= +(0)#! joel +ls -las /dev + + /dest2/home/abc/def/test_script: mode: 0755 want: 0755 ========= /dest2/symlink ========= (0)This is a test of loading an RTEMS filesystem from an initial tar image. -Untaring chunks from tgz- untar: dir: home -untar: file: home/test_file (73) -successful +Untaring chunks from tgz - successful ========= /dest3/home/test_file ========= (0)This is a test of loading an RTEMS filesystem from an initial tar image. +========= /dest3/home/abc/def/test_script ========= +(0)#! joel +ls -las /dev + + /dest3/home/abc/def/test_script: mode: 0755 want: 0755 ========= /dest3/symlink ========= (0)This is a test of loading an RTEMS filesystem from an initial tar image. -*** END OF TAR01 TEST *** + + +*** END OF TEST TAR 1 *** diff --git a/testsuites/libtests/tar01/tar01.tar b/testsuites/libtests/tar01/tar01.tar Binary files differindex 6c6952ef18..9874f426d1 100644 --- a/testsuites/libtests/tar01/tar01.tar +++ b/testsuites/libtests/tar01/tar01.tar diff --git a/testsuites/libtests/tar02/init.c b/testsuites/libtests/tar02/init.c index 809923719b..f25c78ece6 100644 --- a/testsuites/libtests/tar02/init.c +++ b/testsuites/libtests/tar02/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/libtests/tar02/tar02.doc b/testsuites/libtests/tar02/tar02.doc index f2d4c343f0..7e2a4dde16 100644 --- a/testsuites/libtests/tar02/tar02.doc +++ b/testsuites/libtests/tar02/tar02.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. diff --git a/testsuites/libtests/tar03/init.c b/testsuites/libtests/tar03/init.c index 142cdecfdf..50aee936bc 100644 --- a/testsuites/libtests/tar03/init.c +++ b/testsuites/libtests/tar03/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/libtests/tar03/tar03.doc b/testsuites/libtests/tar03/tar03.doc index f09612f1e6..4a979e4ec3 100644 --- a/testsuites/libtests/tar03/tar03.doc +++ b/testsuites/libtests/tar03/tar03.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. diff --git a/testsuites/libtests/telnetd01/init.c b/testsuites/libtests/telnetd01/init.c deleted file mode 100644 index a17126bf41..0000000000 --- a/testsuites/libtests/telnetd01/init.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2018 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/stat.h> -#include <fcntl.h> -#include <string.h> - -#include <rtems.h> -#include <rtems/rtems_bsdnet.h> -#include <rtems/telnetd.h> - -#include <tmacros.h> - -const char rtems_test_name[] = "TELNETD 1"; - -struct rtems_bsdnet_config rtems_bsdnet_config; - -static void command(char *device_name, void *arg) -{ -} - -static void test_command_null(void) -{ - static const rtems_telnetd_config_table config = { - .command = NULL - }; - rtems_status_code sc; - - sc = rtems_telnetd_start(&config); - rtems_test_assert(sc == RTEMS_INVALID_ADDRESS); -} - -static void test_cannot_start_server_task(void) -{ - static const rtems_telnetd_config_table config = { - .command = command, - .priority = UINT32_MAX - }; - rtems_status_code sc; - - sc = rtems_telnetd_start(&config); - rtems_test_assert(sc == RTEMS_UNSATISFIED); -} - -static void test_successful_start(void) -{ - static const rtems_telnetd_config_table config = { - .command = command, - .stack_size = RTEMS_MINIMUM_STACK_SIZE - }; - rtems_status_code sc; - - sc = rtems_telnetd_start(&config); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); -} - -static void test_already_started(void) -{ - static const rtems_telnetd_config_table config = { - .command = command - }; - rtems_status_code sc; - - sc = rtems_telnetd_start(&config); - rtems_test_assert(sc == RTEMS_RESOURCE_IN_USE); -} - -static rtems_task Init(rtems_task_argument argument) -{ - int rv; - - TEST_BEGIN(); - - rv = rtems_bsdnet_initialize_network(); - rtems_test_assert(rv == 0); - - test_command_null(); - test_cannot_start_server_task(); - test_successful_start(); - test_already_started(); - - TEST_END(); - rtems_test_exit(0); -} - -#define CONFIGURE_INIT - -#define CONFIGURE_MICROSECONDS_PER_TICK 10000 - -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS (3 + 1 + 5 * 4) - -#define CONFIGURE_MAXIMUM_TASKS 8 - -#define CONFIGURE_MAXIMUM_POSIX_KEYS 1 - -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT - -#include <rtems/confdefs.h> diff --git a/testsuites/libtests/telnetd01/telnetd01.doc b/testsuites/libtests/telnetd01/telnetd01.doc deleted file mode 100644 index fe1a4d31a3..0000000000 --- a/testsuites/libtests/telnetd01/telnetd01.doc +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2018 embedded brains GmbH. All rights reserved. -# -# embedded brains GmbH -# Dornierstr. 4 -# 82178 Puchheim -# Germany -# <rtems@embedded-brains.de> -# -# 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. - -This file describes the directives and concepts tested by this test set. - -test set name: telnetd01 - -directives: - - - rtems_telnetd_start() - -concepts: - -+ Check if Telnet server works. diff --git a/testsuites/libtests/telnetd01/telnetd01.scn b/testsuites/libtests/telnetd01/telnetd01.scn deleted file mode 100644 index 3e9cc0007a..0000000000 --- a/testsuites/libtests/telnetd01/telnetd01.scn +++ /dev/null @@ -1,11 +0,0 @@ -*** BEGIN OF TEST TELNETD 1 *** -*** TEST VERSION: 5.0.0.dc32b6aa0807fb70f9b26bc0bc6e164ddb49bd3a -*** TEST STATE: EXPECTED_PASS -*** TEST BUILD: RTEMS_NETWORKING -*** TEST TOOLS: 7.3.0 20180125 (RTEMS 5, RSB 9670d7541e0621915e521fe76e7bb33de8cee661, Newlib d13c84eb07e35984bf7a974cd786a6cdac29e6b9) -syslog: telnetd: configuration with invalid command -syslog: telnetd: cannot create session task -syslog: telnetd: started successfully on port 23 -syslog: telnetd: cannot bind server socket - -*** END OF TEST TELNETD 1 *** diff --git a/testsuites/libtests/termios/README b/testsuites/libtests/termios/README index 2b8fcab856..7ff007c778 100644 --- a/testsuites/libtests/termios/README +++ b/testsuites/libtests/termios/README @@ -82,10 +82,7 @@ Clear??? --- Eric Norum -eric@skatter.usask.ca -Saskatchewan Accelerator Laboratory -University of Saskatchewan -Saskatoon, Canada. +eric@norum.ca Charles-Antoine Gauthier Software Engineering Group diff --git a/testsuites/libtests/termios/init.c b/testsuites/libtests/termios/init.c index 558f095449..81ca5b75e6 100644 --- a/testsuites/libtests/termios/init.c +++ b/testsuites/libtests/termios/init.c @@ -1,19 +1,13 @@ /* * RTEMS configuration/initialization - * + */ + +/* * This program may be distributed and used for any purpose. - * I ask only that you: - * 1. Leave this author information intact. - * 2. Document any changes you make. * - * W. Eric Norum - * Saskatchewan Accelerator Laboratory - * University of Saskatchewan - * Saskatoon, Saskatchewan, CANADA - * eric@skatter.usask.ca + * Copyright (c) 1997 Eric Norum <eric@norum.ca> * - * Additions: - * Charles-Antoine Gauthier + * Copyright (c) 2000 Charles-Antoine Gauthier <charles.gauthier@nrc.ca> * Software Engineering Group * Institute for Information Technology * National Research Council of Canada diff --git a/testsuites/libtests/termios01/init.c b/testsuites/libtests/termios01/init.c index 09be07bbcc..13c28490e1 100644 --- a/testsuites/libtests/termios01/init.c +++ b/testsuites/libtests/termios01/init.c @@ -1,10 +1,29 @@ +/* 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. */ #ifdef HAVE_CONFIG_H diff --git a/testsuites/libtests/termios01/termios01.doc b/testsuites/libtests/termios01/termios01.doc index ebc9c7aef2..2ba39696c9 100644 --- a/testsuites/libtests/termios01/termios01.doc +++ b/testsuites/libtests/termios01/termios01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # 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. # This file describes the directives and concepts tested by this test set. diff --git a/testsuites/libtests/termios01/termios_testdriver.c b/testsuites/libtests/termios01/termios_testdriver.c index bd5c7a12d2..49810a37e0 100644 --- a/testsuites/libtests/termios01/termios_testdriver.c +++ b/testsuites/libtests/termios01/termios_testdriver.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -8,9 +10,26 @@ * 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 @@ -173,7 +192,7 @@ rtems_device_driver termios_test_driver_open( termios_test_driver_set_attributes, /* setAttributes */ NULL, /* stopRemoteTx */ NULL, /* startRemoteTx */ - 0 /* outputUsesInterrupts */ + TERMIOS_POLLED /* outputUsesInterrupts */ }; if ( minor > 2 ) { diff --git a/testsuites/libtests/termios01/termios_testdriver.h b/testsuites/libtests/termios01/termios_testdriver.h index f7f1241e9d..ba26a0485c 100644 --- a/testsuites/libtests/termios01/termios_testdriver.h +++ b/testsuites/libtests/termios01/termios_testdriver.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file termios_testdriver.h */ @@ -6,9 +8,26 @@ * 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. */ #ifndef _TERMIOS_TESTDRIVER_H diff --git a/testsuites/libtests/termios02/init.c b/testsuites/libtests/termios02/init.c index fe16150513..06869bc4a5 100644 --- a/testsuites/libtests/termios02/init.c +++ b/testsuites/libtests/termios02/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/libtests/termios02/termios02.doc b/testsuites/libtests/termios02/termios02.doc index 4e0c03555c..5816810cec 100644 --- a/testsuites/libtests/termios02/termios02.doc +++ b/testsuites/libtests/termios02/termios02.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # 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. # This file describes the directives and concepts tested by this test set. diff --git a/testsuites/libtests/termios03/init.c b/testsuites/libtests/termios03/init.c index 6f602f4df9..5600d2584a 100644 --- a/testsuites/libtests/termios03/init.c +++ b/testsuites/libtests/termios03/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/libtests/termios03/termios03.doc b/testsuites/libtests/termios03/termios03.doc index 5905f8cd6c..0e30571dc4 100644 --- a/testsuites/libtests/termios03/termios03.doc +++ b/testsuites/libtests/termios03/termios03.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. diff --git a/testsuites/libtests/termios03/termios_testdriver_polled.c b/testsuites/libtests/termios03/termios_testdriver_polled.c index 676c3aacbd..8daf8d6685 100644 --- a/testsuites/libtests/termios03/termios_testdriver_polled.c +++ b/testsuites/libtests/termios03/termios_testdriver_polled.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -8,9 +10,26 @@ * 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 @@ -140,7 +159,7 @@ rtems_device_driver termios_test_driver_open( termios_test_driver_set_attributes, /* setAttributes */ NULL, /* stopRemoteTx */ NULL, /* startRemoteTx */ - 0 /* outputUsesInterrupts */ + TERMIOS_POLLED /* outputUsesInterrupts */ }; if ( minor > 2 ) { diff --git a/testsuites/libtests/termios03/termios_testdriver_polled.h b/testsuites/libtests/termios03/termios_testdriver_polled.h index 6288a09a41..d804a2107f 100644 --- a/testsuites/libtests/termios03/termios_testdriver_polled.h +++ b/testsuites/libtests/termios03/termios_testdriver_polled.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file termios_testdriver.h */ @@ -6,9 +8,26 @@ * 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. */ #ifndef _TERMIOS_TESTDRIVER_H diff --git a/testsuites/libtests/termios04/init.c b/testsuites/libtests/termios04/init.c index fe2adeb40d..4bee57def2 100644 --- a/testsuites/libtests/termios04/init.c +++ b/testsuites/libtests/termios04/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/libtests/termios04/termios04.doc b/testsuites/libtests/termios04/termios04.doc index 3ad36a49d7..823c0d816e 100644 --- a/testsuites/libtests/termios04/termios04.doc +++ b/testsuites/libtests/termios04/termios04.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. diff --git a/testsuites/libtests/termios04/termios_testdriver_impl.h b/testsuites/libtests/termios04/termios_testdriver_impl.h index 53764fb9da..740f9e0778 100644 --- a/testsuites/libtests/termios04/termios_testdriver_impl.h +++ b/testsuites/libtests/termios04/termios_testdriver_impl.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -8,9 +10,26 @@ * 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 @@ -252,7 +271,7 @@ rtems_device_driver termios_test_driver_open( #if defined(TASK_DRIVEN) TERMIOS_TASK_DRIVEN /* outputUsesInterrupts */ #else - 0 /* outputUsesInterrupts */ + TERMIOS_POLLED /* outputUsesInterrupts */ #endif }; diff --git a/testsuites/libtests/termios04/termios_testdriver_intr.c b/testsuites/libtests/termios04/termios_testdriver_intr.c index 5946c29a4e..7d524ae151 100644 --- a/testsuites/libtests/termios04/termios_testdriver_intr.c +++ b/testsuites/libtests/termios04/termios_testdriver_intr.c @@ -1 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup libtests + * + * @brief This is termios_testdriver_intr for termios04. + */ + +/* + * Copyright (C) 1989-2012 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. + */ + #include "termios_testdriver_impl.h" diff --git a/testsuites/libtests/termios04/termios_testdriver_intr.h b/testsuites/libtests/termios04/termios_testdriver_intr.h index f4ebb59e53..f3f1815740 100644 --- a/testsuites/libtests/termios04/termios_testdriver_intr.h +++ b/testsuites/libtests/termios04/termios_testdriver_intr.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file termios_testdriver.h */ @@ -6,9 +8,26 @@ * 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. */ #ifndef _TERMIOS_TESTDRIVER_H diff --git a/testsuites/libtests/termios05/init.c b/testsuites/libtests/termios05/init.c index 1cd5c7371d..8f40ed5007 100644 --- a/testsuites/libtests/termios05/init.c +++ b/testsuites/libtests/termios05/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/libtests/termios05/termios05.doc b/testsuites/libtests/termios05/termios05.doc index 009a288664..08ae1d5ee1 100644 --- a/testsuites/libtests/termios05/termios05.doc +++ b/testsuites/libtests/termios05/termios05.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. diff --git a/testsuites/libtests/termios05/termios_testdriver_task.c b/testsuites/libtests/termios05/termios_testdriver_task.c index e1b31810a7..d38182c631 100644 --- a/testsuites/libtests/termios05/termios_testdriver_task.c +++ b/testsuites/libtests/termios05/termios_testdriver_task.c @@ -1,2 +1,37 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup libtests + * + * @brief This is termios_testdriver_task for termios05. + */ + +/* + * Copyright (C) 1989-2010 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. + */ + #define TASK_DRIVEN #include "../termios04/termios_testdriver_impl.h" diff --git a/testsuites/libtests/termios06/init.c b/testsuites/libtests/termios06/init.c index 5104d1b724..5705ecb35f 100644 --- a/testsuites/libtests/termios06/init.c +++ b/testsuites/libtests/termios06/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/libtests/termios06/termios06.doc b/testsuites/libtests/termios06/termios06.doc index 9bedda7a0b..beaf0ea64c 100644 --- a/testsuites/libtests/termios06/termios06.doc +++ b/testsuites/libtests/termios06/termios06.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. diff --git a/testsuites/libtests/termios06/test_pppd.c b/testsuites/libtests/termios06/test_pppd.c index d674e7b5e4..a6f68a956c 100644 --- a/testsuites/libtests/termios06/test_pppd.c +++ b/testsuites/libtests/termios06/test_pppd.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 @@ -25,7 +44,7 @@ int pppread(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args); int pppwrite(struct rtems_termios_tty *tty, rtems_libio_rw_args_t *rw_args); int pppioctl(struct rtems_termios_tty *tty, rtems_libio_ioctl_args_t *args); int pppinput(int c, struct rtems_termios_tty *tty); -int pppstart(struct rtems_termios_tty *tp); +int pppstart(struct rtems_termios_tty *tp, int len); /* * Define the PPP line discipline. @@ -97,7 +116,7 @@ int pppinput(int c, struct rtems_termios_tty *tty) return 0; } -int pppstart(struct rtems_termios_tty *tp) +int pppstart(struct rtems_termios_tty *tp, int len) { puts( "pppstart called" ); return 0; diff --git a/testsuites/libtests/termios07/init.c b/testsuites/libtests/termios07/init.c index 1dd5315126..53486912f4 100644 --- a/testsuites/libtests/termios07/init.c +++ b/testsuites/libtests/termios07/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/libtests/termios07/termios07.doc b/testsuites/libtests/termios07/termios07.doc index 938a12636f..05550e0209 100644 --- a/testsuites/libtests/termios07/termios07.doc +++ b/testsuites/libtests/termios07/termios07.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. diff --git a/testsuites/libtests/termios08/init.c b/testsuites/libtests/termios08/init.c index 4f237fb367..e3f5d236db 100644 --- a/testsuites/libtests/termios08/init.c +++ b/testsuites/libtests/termios08/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/libtests/termios08/termios08.doc b/testsuites/libtests/termios08/termios08.doc index 2a7eb09594..9fd2e1c340 100644 --- a/testsuites/libtests/termios08/termios08.doc +++ b/testsuites/libtests/termios08/termios08.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. diff --git a/testsuites/libtests/termios09/init.c b/testsuites/libtests/termios09/init.c index 5490b2b918..a7c2518ecc 100644 --- a/testsuites/libtests/termios09/init.c +++ b/testsuites/libtests/termios09/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2017 embedded brains GmbH. All rights reserved. + * Copyright (c) 2017 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Dornierstr. 4 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/termios10/init.c b/testsuites/libtests/termios10/init.c index 8655879500..397acd0879 100644 --- a/testsuites/libtests/termios10/init.c +++ b/testsuites/libtests/termios10/init.c @@ -1 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup libtests + * + * @brief This is init for termios10. + */ + +/* + * Copyright (C) 2019 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. + */ + #include "termios10impl.h" diff --git a/testsuites/libtests/termios11/init.c b/testsuites/libtests/termios11/init.c index 3492a62753..6c8d45dda1 100644 --- a/testsuites/libtests/termios11/init.c +++ b/testsuites/libtests/termios11/init.c @@ -1,2 +1,37 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @ingroup libtests + * + * @brief This is init for termios11. + */ + +/* + * Copyright (C) 1989-2019 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. + */ + #define INTERRUPT_DRIVEN #include "../termios10/termios10impl.h" diff --git a/testsuites/libtests/top/init.c b/testsuites/libtests/top/init.c index 8a824ae194..34ce3e5291 100644 --- a/testsuites/libtests/top/init.c +++ b/testsuites/libtests/top/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * This test checks rtems_cpu_usage_top command with * 30 tasks being created and deleted. The command @@ -12,9 +14,26 @@ * COPYRIGHT (c) 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 diff --git a/testsuites/libtests/top/system.h b/testsuites/libtests/top/system.h index 945fbcabca..9abcf0d555 100644 --- a/testsuites/libtests/top/system.h +++ b/testsuites/libtests/top/system.h @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* system.h * * This include file contains information that is included in every @@ -6,9 +8,26 @@ * COPYRIGHT (c) 1989-1999. * 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. */ #include <bsp.h> diff --git a/testsuites/libtests/top/task1.c b/testsuites/libtests/top/task1.c index c9e62dffb6..8fcf23fc34 100644 --- a/testsuites/libtests/top/task1.c +++ b/testsuites/libtests/top/task1.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Task_1 * * This test serves as a test task. It creates and deletes @@ -13,9 +15,26 @@ * COPYRIGHT (c) 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 diff --git a/testsuites/libtests/top/task2.c b/testsuites/libtests/top/task2.c index 5435d5b66a..e4fbaff812 100644 --- a/testsuites/libtests/top/task2.c +++ b/testsuites/libtests/top/task2.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Task_2 * * This routine serves as a test task. It calls the @@ -11,9 +13,26 @@ * COPYRIGHT (c) 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 diff --git a/testsuites/libtests/top/task3.c b/testsuites/libtests/top/task3.c index 891351bad9..2a22a17b39 100644 --- a/testsuites/libtests/top/task3.c +++ b/testsuites/libtests/top/task3.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* Task_3 * * This routine serves as a test task. It receives a task @@ -12,9 +14,26 @@ * COPYRIGHT (c) 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 diff --git a/testsuites/libtests/ttest01/init.c b/testsuites/libtests/ttest01/init.c index 35b7023385..433bc0581b 100644 --- a/testsuites/libtests/ttest01/init.c +++ b/testsuites/libtests/ttest01/init.c @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,6 +28,7 @@ #include <rtems/test.h> #include <sys/time.h> +#include <stdlib.h> #include <string.h> #include <rtems.h> @@ -129,6 +130,8 @@ static const char censored_init[] = "A:ttest01\n" "S:Compiler:*" "S:Version:*" "S:BSP:*" +"S:BuildLabel:*" +"S:TargetHash:SHA256:*" "S:RTEMS_DEBUG:*" "S:RTEMS_MULTIPROCESSING:*" "S:RTEMS_POSIX_API:*" @@ -160,7 +163,9 @@ censor_putchar(int c, void *arg) } else if (c == *ctx->censor_c) { (*ctx->putchar)(c, ctx->putchar_arg); ++ctx->censor_c; - } + } else { + test_assert(0); + } break; case CENSOR_DISCARD: if (c == '\n') { @@ -182,8 +187,8 @@ run_initialize(void) T_set_putchar(censor_putchar, ctx, &ctx->putchar, &ctx->putchar_arg); } -static const char expected_final[] = "Z:ttest01:C:343:N:1335:F:795:D:0.689999\n" -"Y:ReportHash:SHA256:f018ab0c9ddf5c5bc0ba8377492dc52205f9b63146c787fb669222e346c65d0f\n"; +static const char expected_final[] = "Z:ttest01:C:344:N:1339:F:795:D:0.691999\n" +"Y:ReportHash:SHA256:LgRLA4VlIDzeH_dLPihAOjqW8IAujT-Co3FwBloXoKE=\n"; static void run_finalize(void) @@ -255,6 +260,8 @@ static const T_config config = { .putchar_arg = &test_instance, .verbosity = T_VERBOSE, .now = now, + .allocate = malloc, + .deallocate = free, .action_count = T_ARRAY_SIZE(actions), .actions = actions }; diff --git a/testsuites/libtests/ttest01/t-self-test.h b/testsuites/libtests/ttest01/t-self-test.h index 1035872c9d..d2767d5e70 100644 --- a/testsuites/libtests/ttest01/t-self-test.h +++ b/testsuites/libtests/ttest01/t-self-test.h @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (C) 2019 embedded brains GmbH + * Copyright (C) 2019 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/libtests/ttest01/test-assert.c b/testsuites/libtests/ttest01/test-assert.c index 398539fe8e..2a401ca577 100644 --- a/testsuites/libtests/ttest01/test-assert.c +++ b/testsuites/libtests/ttest01/test-assert.c @@ -86,7 +86,7 @@ T_TEST_OUTPUT(assert2, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-checks.c b/testsuites/libtests/ttest01/test-checks.c index fa5591121e..14f3cda44c 100644 --- a/testsuites/libtests/ttest01/test-checks.c +++ b/testsuites/libtests/ttest01/test-checks.c @@ -5415,7 +5415,7 @@ T_TEST_OUTPUT(check_false_no_fmt, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-destructor.c b/testsuites/libtests/ttest01/test-destructor.c index 71b14c08f6..5e30e6c203 100644 --- a/testsuites/libtests/ttest01/test-destructor.c +++ b/testsuites/libtests/ttest01/test-destructor.c @@ -4,7 +4,7 @@ static void destroy(T_destructor *dtor) { (void)dtor; - T_step(0, "destroy"); + T_step(0); } T_TEST_CASE(destructor) @@ -31,7 +31,7 @@ T_TEST_OUTPUT(destructor, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-eno.c b/testsuites/libtests/ttest01/test-eno.c index c334b5e1f7..744feb6434 100644 --- a/testsuites/libtests/ttest01/test-eno.c +++ b/testsuites/libtests/ttest01/test-eno.c @@ -50,7 +50,7 @@ T_TEST_OUTPUT(test_eno_success, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-example.c b/testsuites/libtests/ttest01/test-example.c index 6fa062f6c8..94bd9487db 100644 --- a/testsuites/libtests/ttest01/test-example.c +++ b/testsuites/libtests/ttest01/test-example.c @@ -32,7 +32,7 @@ T_TEST_OUTPUT(example, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-fixture.c b/testsuites/libtests/ttest01/test-fixture.c index 545fbf19dc..3cc0f64d63 100644 --- a/testsuites/libtests/ttest01/test-fixture.c +++ b/testsuites/libtests/ttest01/test-fixture.c @@ -43,11 +43,11 @@ teardown(void *ctx) T_log(T_QUIET, "teardown end"); } -static void +static size_t scope(void *ctx, char *buf, size_t n) { - strlcpy(buf, "/More", n); + return T_str_copy(buf, "/More", n); } static const T_fixture fixture = { @@ -101,11 +101,11 @@ teardown_2(void *ctx) T_log(T_QUIET, "teardown 2 end"); } -static void +static size_t scope_2(void *ctx, char *buf, size_t n) { - strlcpy(buf, "/AndMore", n); + return T_str_copy(buf, "/AndMore", n); } static const T_fixture fixture_2 = { @@ -144,35 +144,35 @@ T_TEST_OUTPUT(fixture, "L:setup end\n" "P:3:0:UI1/More:test-fixture.c:125\n" "L:setup 2 begin\n" -"P:4:0:UI1/More/AndMore:test-fixture.c:71\n" -"P:5:0:UI1/More/AndMore:test-fixture.c:72\n" -"P:6:0:UI1/More/AndMore:test-fixture.c:76\n" +"P:4.0:0:UI1/More/AndMore:test-fixture.c:71\n" +"P:4.1:0:UI1/More/AndMore:test-fixture.c:72\n" +"P:4.2:0:UI1/More/AndMore:test-fixture.c:76\n" "L:setup 2 end\n" -"P:7:0:UI1/More/AndMore:test-fixture.c:127\n" +"P:4.3:0:UI1/More/AndMore:test-fixture.c:127\n" "L:teardown 2 begin\n" -"P:8:0:UI1/More:test-fixture.c:98\n" -"P:9:0:UI1/More:test-fixture.c:100\n" +"P:4.4:0:UI1/More/AndMore:test-fixture.c:98\n" +"P:4.5:0:UI1/More/AndMore:test-fixture.c:100\n" "L:teardown 2 end\n" "L:setup 2 begin\n" -"P:10:0:UI1/More/AndMore:test-fixture.c:71\n" -"P:11:0:UI1/More/AndMore:test-fixture.c:72\n" -"P:12:0:UI1/More/AndMore:test-fixture.c:76\n" +"P:4.0:0:UI1/More/AndMore:test-fixture.c:71\n" +"P:4.1:0:UI1/More/AndMore:test-fixture.c:72\n" +"P:4.2:0:UI1/More/AndMore:test-fixture.c:76\n" "L:setup 2 end\n" -"P:13:0:UI1/More/AndMore:test-fixture.c:131\n" -"F:14:0:UI1/More/AndMore:test-fixture.c:132:test fails and we stop the test case\n" +"P:4.3:0:UI1/More/AndMore:test-fixture.c:131\n" +"F:4.4:0:UI1/More/AndMore:test-fixture.c:132:test fails and we stop the test case\n" "L:stop 2 begin\n" -"P:15:0:UI1/More/AndMore:test-fixture.c:86\n" +"P:4.5:0:UI1/More/AndMore:test-fixture.c:86\n" "L:stop 2 end\n" "L:stop begin\n" -"P:16:0:UI1/More/AndMore:test-fixture.c:28\n" +"P:4.6:0:UI1/More/AndMore:test-fixture.c:28\n" "L:stop end\n" "L:teardown 2 begin\n" -"P:17:0:UI1/More/AndMore:test-fixture.c:98\n" -"P:18:0:UI1/More/AndMore:test-fixture.c:100\n" +"P:4.7:0:UI1/More/AndMore:test-fixture.c:98\n" +"P:4.8:0:UI1/More/AndMore:test-fixture.c:100\n" "L:teardown 2 end\n" "L:teardown begin\n" -"P:19:0:UI1/More:test-fixture.c:40\n" -"P:20:0:UI1/More:test-fixture.c:42\n" +"P:4:0:UI1/More:test-fixture.c:40\n" +"P:5:0:UI1/More:test-fixture.c:42\n" "L:teardown end\n" "E:fixture:N:21:F:1:D:0.001000\n"); @@ -185,7 +185,7 @@ T_TEST_OUTPUT(fixture, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2020 embedded brains GmbH + * Copyright (C) 2018, 2020 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/libtests/ttest01/test-leak.c b/testsuites/libtests/ttest01/test-leak.c index 923ad1989c..c63ef0cd48 100644 --- a/testsuites/libtests/ttest01/test-leak.c +++ b/testsuites/libtests/ttest01/test-leak.c @@ -215,7 +215,7 @@ T_TEST_OUTPUT(missing_key_delete, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-log.c b/testsuites/libtests/ttest01/test-log.c index bf1b822c0e..38573f2f6b 100644 --- a/testsuites/libtests/ttest01/test-log.c +++ b/testsuites/libtests/ttest01/test-log.c @@ -23,7 +23,7 @@ T_TEST_OUTPUT(log, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-malloc.c b/testsuites/libtests/ttest01/test-malloc.c index 14066ddf7b..ffaa4c6682 100644 --- a/testsuites/libtests/ttest01/test-malloc.c +++ b/testsuites/libtests/ttest01/test-malloc.c @@ -93,7 +93,7 @@ T_TEST_OUTPUT(calloc_auto, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-plan.c b/testsuites/libtests/ttest01/test-plan.c index 155704c478..0b8ccd4477 100644 --- a/testsuites/libtests/ttest01/test-plan.c +++ b/testsuites/libtests/ttest01/test-plan.c @@ -28,10 +28,23 @@ T_TEST_CASE(double_plan) T_TEST_CASE(steps) { - T_step(0, "a"); + T_step(0); T_plan(3); - T_step(1, "b"); - T_step(2, "c"); + T_step(1); + T_step(2); +} + +static T_fixture_node nested_plan_node; + +T_TEST_CASE(nested_plan) +{ + T_plan(2); + T_step(0); + T_push_plan(&nested_plan_node, 2); + T_step(0); + T_step(1); + T_pop_plan(); + T_step(1); } #include "t-self-test.h" @@ -65,6 +78,14 @@ T_TEST_OUTPUT(steps, "P:2:0:UI1:test-plan.c:34\n" "E:steps:N:3:F:0:D:0.001000\n"); +T_TEST_OUTPUT(nested_plan, +"B:nested_plan\n" +"P:0:0:UI1:test-plan.c:42\n" +"P:1.0:0:UI1:test-plan.c:44\n" +"P:1.1:0:UI1:test-plan.c:45\n" +"P:1:0:UI1:test-plan.c:47\n" +"E:nested_plan:N:4:F:0:D:0.001000\n"); + /* * The license is at the end of the file to be able to use the test code and * output in examples in the documentation. This is also the reason for the @@ -74,7 +95,7 @@ T_TEST_OUTPUT(steps, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-psx.c b/testsuites/libtests/ttest01/test-psx.c index b43fd96846..9b82543c26 100644 --- a/testsuites/libtests/ttest01/test-psx.c +++ b/testsuites/libtests/ttest01/test-psx.c @@ -72,7 +72,7 @@ T_TEST_OUTPUT(test_psx_success, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-rtems.c b/testsuites/libtests/ttest01/test-rtems.c index 1f94b7318c..a44323886e 100644 --- a/testsuites/libtests/ttest01/test-rtems.c +++ b/testsuites/libtests/ttest01/test-rtems.c @@ -111,7 +111,7 @@ T_TEST_OUTPUT(rsc_success, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-simple.c b/testsuites/libtests/ttest01/test-simple.c index f98e3a1dfa..7732d2f937 100644 --- a/testsuites/libtests/ttest01/test-simple.c +++ b/testsuites/libtests/ttest01/test-simple.c @@ -31,7 +31,7 @@ T_TEST_OUTPUT(a_test_case, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-step.c b/testsuites/libtests/ttest01/test-step.c index 6d5ee9f7ab..38d0cb6518 100644 --- a/testsuites/libtests/ttest01/test-step.c +++ b/testsuites/libtests/ttest01/test-step.c @@ -23,7 +23,7 @@ T_TEST_OUTPUT(step, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-task-context.c b/testsuites/libtests/ttest01/test-task-context.c index 56139f9474..884e3e3d34 100644 --- a/testsuites/libtests/ttest01/test-task-context.c +++ b/testsuites/libtests/ttest01/test-task-context.c @@ -23,7 +23,7 @@ T_TEST_OUTPUT(check_task_context, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2019 embedded brains GmbH + * Copyright (C) 2019 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/libtests/ttest01/test-time.c b/testsuites/libtests/ttest01/test-time.c index a324290e56..2b5039015b 100644 --- a/testsuites/libtests/ttest01/test-time.c +++ b/testsuites/libtests/ttest01/test-time.c @@ -280,7 +280,7 @@ T_TEST_OUTPUT(begin_time, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest01/test-verbosity.c b/testsuites/libtests/ttest01/test-verbosity.c index 486969c85c..fc54724ce1 100644 --- a/testsuites/libtests/ttest01/test-verbosity.c +++ b/testsuites/libtests/ttest01/test-verbosity.c @@ -34,7 +34,7 @@ T_TEST_OUTPUT(verbosity_changes, /* * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 * - * Copyright (C) 2018, 2019 embedded brains GmbH + * Copyright (C) 2018, 2019 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/libtests/ttest02/init.c b/testsuites/libtests/ttest02/init.c index 78c874faf7..881bbedc92 100644 --- a/testsuites/libtests/ttest02/init.c +++ b/testsuites/libtests/ttest02/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 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +32,8 @@ #include <rtems/test.h> #include <rtems/test-info.h> +#include <string.h> + #include <rtems.h> static void @@ -132,6 +134,7 @@ static void fatal(void *arg) { (void)arg; + T_plan(1); T_step(0); T_stop(); } @@ -147,7 +150,6 @@ T_TEST_CASE(TestInterruptFatal) { Atomic_Uint action_state; - T_plan(1); T_interrupt_test(&fatal_config, &action_state); T_unreachable(); } @@ -159,6 +161,7 @@ suspend(void *arg) rtems_id *id; id = arg; + T_plan(2); sc = rtems_task_suspend(*id); T_step_rsc_success(1, sc); } @@ -200,10 +203,74 @@ T_TEST_CASE(TestInterruptBlocked) T_interrupt_test_state state; rtems_id id; - T_plan(3); + T_plan(1); id = rtems_task_self(); state = T_interrupt_test(&blocked_config, &id); - T_step_eq_int(2, state, T_INTERRUPT_TEST_DONE); + T_step_eq_int(0, state, T_INTERRUPT_TEST_DONE); +} + +T_TEST_CASE(TestThreadSwitch) +{ + T_thread_switch_log_2 log_2; + T_thread_switch_log_4 log_4; + T_thread_switch_log_10 log_10; + T_thread_switch_log *log; + uint32_t executing; + uint32_t heir; + size_t i; + + memset(&log_2, 0xff, sizeof(log_2)); + log = T_thread_switch_record_2(&log_2); + T_null(log); + T_eq_sz(log_2.header.recorded, 0); + T_eq_sz(log_2.header.capacity, 2); + T_eq_u64(log_2.header.switches, 0); + + memset(&log_4, 0xff, sizeof(log_4)); + log = T_thread_switch_record_4(&log_4); + T_eq_ptr(&log->header, &log_2.header); + T_eq_sz(log_4.header.recorded, 0); + T_eq_sz(log_4.header.capacity, 4); + T_eq_u64(log_4.header.switches, 0); + + memset(&log_10, 0xff, sizeof(log_10)); + log = T_thread_switch_record_10(&log_10); + T_eq_ptr(&log->header, &log_4.header); + T_eq_sz(log_10.header.recorded, 0); + T_eq_sz(log_10.header.capacity, 10); + T_eq_u64(log_10.header.switches, 0); + + for (i = 0; i < 6; ++i) { + rtems_status_code sc; + + sc = rtems_task_wake_after(2); + T_rsc_success(sc); + } + + log = T_thread_switch_record(NULL); + T_eq_ptr(&log->header, &log_10.header); + T_eq_sz(log->header.recorded, 10); + T_eq_sz(log->header.capacity, 10); + T_eq_u64(log->header.switches, 12); + executing = rtems_task_self(); + T_eq_u32(log->events[0].executing, executing); + T_ne_u32(log->events[0].heir, 0); + heir = log->events[0].heir; + T_eq_u32(log->events[0].cpu, 0); + T_ne_u64(log->events[0].instant, 0); + + for (i = 1; i < 10; ++i) { + uint32_t tmp; + + tmp = executing; + executing = heir; + heir = tmp; + + T_eq_u32(log->events[i].executing, executing); + T_eq_u32(log->events[i].heir, heir); + T_eq_u32(log->events[i].cpu, 0); + T_gt_u64(log->events[i].instant, log->events[i - 1].instant); + } } const char rtems_test_name[] = "TTEST 2"; diff --git a/testsuites/libtests/tztest/init.c b/testsuites/libtests/tztest/init.c index f3085078ed..c88472da04 100644 --- a/testsuites/libtests/tztest/init.c +++ b/testsuites/libtests/tztest/init.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /** * @file * @@ -9,9 +11,26 @@ * COPYRIGHT (c) 2007-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/libtests/uid01/init.c b/testsuites/libtests/uid01/init.c index fcc3071345..be6b026f00 100644 --- a/testsuites/libtests/uid01/init.c +++ b/testsuites/libtests/uid01/init.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2013 Daniel Ramirez <javamonn@gmail.com> * - * 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/libtests/uid01/msmouse.c b/testsuites/libtests/uid01/msmouse.c index 35cbc2452e..18732ee534 100644 --- a/testsuites/libtests/uid01/msmouse.c +++ b/testsuites/libtests/uid01/msmouse.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2013 Daniel Ramirez <javamonn@gmail.com> * - * 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/libtests/uid01/serial_mouse_config.c b/testsuites/libtests/uid01/serial_mouse_config.c index 78c8602257..b05d303ade 100644 --- a/testsuites/libtests/uid01/serial_mouse_config.c +++ b/testsuites/libtests/uid01/serial_mouse_config.c @@ -1,9 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* * Copyright (c) 2013 Daniel Ramirez <javamonn@gmail.com> * - * 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. */ /* diff --git a/testsuites/libtests/uid01/uid01.doc b/testsuites/libtests/uid01/uid01.doc index a86a00a8f0..7c266dc406 100644 --- a/testsuites/libtests/uid01/uid01.doc +++ b/testsuites/libtests/uid01/uid01.doc @@ -1,8 +1,27 @@ +# SPDX-License-Identifier: BSD-2-Clause + # Copyright (c) 2013 Daniel Ramirez <javamonn@gmail.com> # -# 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. diff --git a/testsuites/libtests/utf8proc01/init.c b/testsuites/libtests/utf8proc01/init.c index 48120dd198..71a8936257 100644 --- a/testsuites/libtests/utf8proc01/init.c +++ b/testsuites/libtests/utf8proc01/init.c @@ -1,15 +1,28 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* - * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * Copyright (c) 2012 embedded brains GmbH & Co. KG * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> + * 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. * - * 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. + * 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/libtests/utf8proc01/utf8proc01.doc b/testsuites/libtests/utf8proc01/utf8proc01.doc index 099c98905d..ac573f49a1 100644 --- a/testsuites/libtests/utf8proc01/utf8proc01.doc +++ b/testsuites/libtests/utf8proc01/utf8proc01.doc @@ -1,9 +1,28 @@ +# SPDX-License-Identifier: BSD-2-Clause + # COPYRIGHT (c) 1989-2013. # 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. |