summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/libtests')
-rw-r--r--testsuites/libtests/block01/block01.doc2
-rw-r--r--testsuites/libtests/block01/init.c2
-rw-r--r--testsuites/libtests/block02/block02.doc2
-rw-r--r--testsuites/libtests/block02/init.c2
-rw-r--r--testsuites/libtests/block03/block03.doc2
-rw-r--r--testsuites/libtests/block03/init.c2
-rw-r--r--testsuites/libtests/block04/block04.doc2
-rw-r--r--testsuites/libtests/block04/init.c2
-rw-r--r--testsuites/libtests/block05/block05.doc2
-rw-r--r--testsuites/libtests/block05/init.c2
-rw-r--r--testsuites/libtests/block07/block07.doc2
-rw-r--r--testsuites/libtests/block07/init.c2
-rw-r--r--testsuites/libtests/block09/block09.doc2
-rw-r--r--testsuites/libtests/block09/init.c2
-rw-r--r--testsuites/libtests/block10/block10.doc2
-rw-r--r--testsuites/libtests/block10/init.c2
-rw-r--r--testsuites/libtests/block11/init.c2
-rw-r--r--testsuites/libtests/block12/init.c2
-rw-r--r--testsuites/libtests/block13/init.c2
-rw-r--r--testsuites/libtests/block14/init.c2
-rw-r--r--testsuites/libtests/block15/init.c2
-rw-r--r--testsuites/libtests/block16/init.c2
-rw-r--r--testsuites/libtests/block17/init.c2
-rw-r--r--testsuites/libtests/crypt01/init.c2
-rw-r--r--testsuites/libtests/defaultconfig01/init.c2
-rw-r--r--testsuites/libtests/devfs01/init.c2
-rw-r--r--testsuites/libtests/dl01/dl01-o1.c2
-rw-r--r--testsuites/libtests/dl02/dl02-o1.c2
-rw-r--r--testsuites/libtests/dl02/dl02-o2.c2
-rw-r--r--testsuites/libtests/dl05/dl05-o5.cc2
-rw-r--r--testsuites/libtests/dl06/dl06-o1.c2
-rw-r--r--testsuites/libtests/dl06/dl06-o2.c2
-rw-r--r--testsuites/libtests/dl07/dl-load.c1
-rw-r--r--testsuites/libtests/dl07/dl07-o1.c2
-rw-r--r--testsuites/libtests/dl07/dl07-o2.c2
-rw-r--r--testsuites/libtests/dl07/dl07-o3.c2
-rw-r--r--testsuites/libtests/dl07/dl07-o4.c2
-rw-r--r--testsuites/libtests/dl07/dl07-o5.c2
-rw-r--r--testsuites/libtests/dl08/dl08-o1.c2
-rw-r--r--testsuites/libtests/dl08/dl08-o2.c2
-rw-r--r--testsuites/libtests/dl08/dl08-o3.c2
-rw-r--r--testsuites/libtests/dl08/dl08-o4.c2
-rw-r--r--testsuites/libtests/dl08/dl08-o5.c2
-rw-r--r--testsuites/libtests/dl08/dl08-o6-123456789-123456789.c2
-rw-r--r--testsuites/libtests/dl09/dl-load.c18
-rw-r--r--testsuites/libtests/dl09/dl09-o1.c2
-rw-r--r--testsuites/libtests/dl09/dl09-o2.c2
-rw-r--r--testsuites/libtests/dl09/dl09-o3.c2
-rw-r--r--testsuites/libtests/dl09/dl09-o4.c2
-rw-r--r--testsuites/libtests/dl09/dl09-o5.c2
-rw-r--r--testsuites/libtests/dl10/dl10-o1.c2
-rw-r--r--testsuites/libtests/dl10/dl10-o2.c2
-rw-r--r--testsuites/libtests/dl10/dl10-o3.c2
-rw-r--r--testsuites/libtests/dl10/dl10-o4.c2
-rw-r--r--testsuites/libtests/dl10/dl10-o5.c2
-rw-r--r--testsuites/libtests/dl10/dl10-o6.c1
-rw-r--r--testsuites/libtests/dl11/dl-load.c207
-rw-r--r--testsuites/libtests/dl11/dl-load.h33
-rw-r--r--testsuites/libtests/dl11/dl11-o1.c41
-rw-r--r--testsuites/libtests/dl11/dl11.doc44
-rw-r--r--testsuites/libtests/dl11/dl11.scn6
-rw-r--r--testsuites/libtests/dl11/init.c105
-rw-r--r--testsuites/libtests/exit01/init.c2
-rw-r--r--testsuites/libtests/exit02/init.c2
-rw-r--r--testsuites/libtests/exit03/init.c2
-rw-r--r--testsuites/libtests/exit03/stdio.cc2
-rw-r--r--testsuites/libtests/flashdev01/flashdev01.doc11
-rw-r--r--testsuites/libtests/flashdev01/flashdev01.scn2
-rw-r--r--testsuites/libtests/flashdev01/init.c190
-rw-r--r--testsuites/libtests/flashdev01/test_flashdev.c275
-rw-r--r--testsuites/libtests/flashdev01/test_flashdev.h35
-rw-r--r--testsuites/libtests/flashdisk01/init.c2
-rw-r--r--testsuites/libtests/flashdisk01/test-file-system.c2
-rw-r--r--testsuites/libtests/flashdisk01/test-file-system.h2
-rw-r--r--testsuites/libtests/getentropy01/init.c2
-rw-r--r--testsuites/libtests/heapwalk/init.c2
-rw-r--r--testsuites/libtests/i2c01/init.c2
-rw-r--r--testsuites/libtests/irqs01/init.c2
-rw-r--r--testsuites/libtests/libfdt01/init.c2
-rw-r--r--testsuites/libtests/libfdt01/some.dts2
-rw-r--r--testsuites/libtests/malloctest/init.c43
-rw-r--r--testsuites/libtests/md501/init.c2
-rw-r--r--testsuites/libtests/newlib01/init.c2
-rw-r--r--testsuites/libtests/ofw01/some.dts2
-rw-r--r--testsuites/libtests/pwdgrp01/init.c2
-rw-r--r--testsuites/libtests/pwdgrp02/init.c2
-rw-r--r--testsuites/libtests/rbheap01/init.c2
-rw-r--r--testsuites/libtests/record01/init.c2
-rw-r--r--testsuites/libtests/record02/init.c2
-rw-r--r--testsuites/libtests/regulator01/regulator01.c1310
-rw-r--r--testsuites/libtests/regulator01/regulator01.doc67
-rw-r--r--testsuites/libtests/regulator01/rtems_config.c59
-rw-r--r--testsuites/libtests/sha/init.c217
-rw-r--r--testsuites/libtests/shell01/init.c2
-rw-r--r--testsuites/libtests/sparsedisk01/init.c2
-rw-r--r--testsuites/libtests/spi01/init.c2
-rw-r--r--testsuites/libtests/stackchk01/init.c30
-rw-r--r--testsuites/libtests/stackchk01/stackchk01.doc12
-rw-r--r--testsuites/libtests/termios01/termios_testdriver.c2
-rw-r--r--testsuites/libtests/termios03/termios_testdriver_polled.c2
-rw-r--r--testsuites/libtests/termios04/termios_testdriver_impl.h2
-rw-r--r--testsuites/libtests/termios09/init.c2
-rw-r--r--testsuites/libtests/ttest01/init.c2
-rw-r--r--testsuites/libtests/ttest01/t-self-test.h2
-rw-r--r--testsuites/libtests/ttest01/test-assert.c2
-rw-r--r--testsuites/libtests/ttest01/test-checks.c2
-rw-r--r--testsuites/libtests/ttest01/test-destructor.c2
-rw-r--r--testsuites/libtests/ttest01/test-eno.c2
-rw-r--r--testsuites/libtests/ttest01/test-example.c2
-rw-r--r--testsuites/libtests/ttest01/test-fixture.c2
-rw-r--r--testsuites/libtests/ttest01/test-leak.c2
-rw-r--r--testsuites/libtests/ttest01/test-log.c2
-rw-r--r--testsuites/libtests/ttest01/test-malloc.c2
-rw-r--r--testsuites/libtests/ttest01/test-plan.c2
-rw-r--r--testsuites/libtests/ttest01/test-psx.c2
-rw-r--r--testsuites/libtests/ttest01/test-rtems.c2
-rw-r--r--testsuites/libtests/ttest01/test-simple.c2
-rw-r--r--testsuites/libtests/ttest01/test-step.c2
-rw-r--r--testsuites/libtests/ttest01/test-task-context.c2
-rw-r--r--testsuites/libtests/ttest01/test-time.c2
-rw-r--r--testsuites/libtests/ttest01/test-verbosity.c2
-rw-r--r--testsuites/libtests/ttest02/init.c2
-rw-r--r--testsuites/libtests/utf8proc01/init.c2
123 files changed, 2787 insertions, 124 deletions
diff --git a/testsuites/libtests/block01/block01.doc b/testsuites/libtests/block01/block01.doc
index 66fca83ea4..ff4d309f0a 100644
--- a/testsuites/libtests/block01/block01.doc
+++ b/testsuites/libtests/block01/block01.doc
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
-# Copyright (c) 2009 embedded brains GmbH. All rights reserved.
+# 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
diff --git a/testsuites/libtests/block01/init.c b/testsuites/libtests/block01/init.c
index 6af83f7655..7717b0b7e6 100644
--- a/testsuites/libtests/block01/init.c
+++ b/testsuites/libtests/block01/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2009, 2018 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/block02/block02.doc b/testsuites/libtests/block02/block02.doc
index 97f9de2e28..e5b99ec8fe 100644
--- a/testsuites/libtests/block02/block02.doc
+++ b/testsuites/libtests/block02/block02.doc
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
-# Copyright (c) 2009 embedded brains GmbH. All rights reserved.
+# 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
diff --git a/testsuites/libtests/block02/init.c b/testsuites/libtests/block02/init.c
index 3eb399dff4..1e8d179d9d 100644
--- a/testsuites/libtests/block02/init.c
+++ b/testsuites/libtests/block02/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2009, 2018 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/block03/block03.doc b/testsuites/libtests/block03/block03.doc
index 7c31c06765..221c7dd816 100644
--- a/testsuites/libtests/block03/block03.doc
+++ b/testsuites/libtests/block03/block03.doc
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
-# Copyright (c) 2009 embedded brains GmbH. All rights reserved.
+# 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
diff --git a/testsuites/libtests/block03/init.c b/testsuites/libtests/block03/init.c
index d4014e784d..da2fa27589 100644
--- a/testsuites/libtests/block03/init.c
+++ b/testsuites/libtests/block03/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2009, 2018 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/block04/block04.doc b/testsuites/libtests/block04/block04.doc
index 744c4be5be..2c05114636 100644
--- a/testsuites/libtests/block04/block04.doc
+++ b/testsuites/libtests/block04/block04.doc
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
-# Copyright (c) 2009 embedded brains GmbH. All rights reserved.
+# 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
diff --git a/testsuites/libtests/block04/init.c b/testsuites/libtests/block04/init.c
index 92b7d3af7a..cdbab6e3fc 100644
--- a/testsuites/libtests/block04/init.c
+++ b/testsuites/libtests/block04/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2009, 2018 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/block05/block05.doc b/testsuites/libtests/block05/block05.doc
index 4c739d41ee..30a246bdf1 100644
--- a/testsuites/libtests/block05/block05.doc
+++ b/testsuites/libtests/block05/block05.doc
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
-# Copyright (c) 2009, 2010 embedded brains GmbH. All rights reserved.
+# 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
diff --git a/testsuites/libtests/block05/init.c b/testsuites/libtests/block05/init.c
index 9845ec6895..e54fa9bd32 100644
--- a/testsuites/libtests/block05/init.c
+++ b/testsuites/libtests/block05/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2009, 2018 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/block07/block07.doc b/testsuites/libtests/block07/block07.doc
index 7643cb8630..18b2f9f656 100644
--- a/testsuites/libtests/block07/block07.doc
+++ b/testsuites/libtests/block07/block07.doc
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
-# Copyright (c) 2009 embedded brains GmbH. All rights reserved.
+# 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
diff --git a/testsuites/libtests/block07/init.c b/testsuites/libtests/block07/init.c
index 93685ad3b2..a755cde987 100644
--- a/testsuites/libtests/block07/init.c
+++ b/testsuites/libtests/block07/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2009, 2018 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/block09/block09.doc b/testsuites/libtests/block09/block09.doc
index 9522de911a..ffe672eb1d 100644
--- a/testsuites/libtests/block09/block09.doc
+++ b/testsuites/libtests/block09/block09.doc
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
-# Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+# Copyright (c) 2010 embedded brains GmbH & Co. KG
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/block09/init.c b/testsuites/libtests/block09/init.c
index 6c5dfb6ffd..2456952164 100644
--- a/testsuites/libtests/block09/init.c
+++ b/testsuites/libtests/block09/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2009, 2018 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/block10/block10.doc b/testsuites/libtests/block10/block10.doc
index 46ad5c808c..7020cc56c0 100644
--- a/testsuites/libtests/block10/block10.doc
+++ b/testsuites/libtests/block10/block10.doc
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-2-Clause
-# Copyright (c) 2010 embedded brains GmbH. All rights reserved.
+# Copyright (c) 2010 embedded brains GmbH & Co. KG
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/block10/init.c b/testsuites/libtests/block10/init.c
index 3ea1022020..693a8a8908 100644
--- a/testsuites/libtests/block10/init.c
+++ b/testsuites/libtests/block10/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2010, 2018 embedded brains GmbH.
+ * Copyright (C) 2010, 2018 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/block11/init.c b/testsuites/libtests/block11/init.c
index 22ae8e1e5a..5d442e768f 100644
--- a/testsuites/libtests/block11/init.c
+++ b/testsuites/libtests/block11/init.c
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/block12/init.c b/testsuites/libtests/block12/init.c
index 7d488a9fe9..ad51974fec 100644
--- a/testsuites/libtests/block12/init.c
+++ b/testsuites/libtests/block12/init.c
@@ -1,7 +1,7 @@
/* 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
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/block13/init.c b/testsuites/libtests/block13/init.c
index 9b6f3ed09d..c91ce8818d 100644
--- a/testsuites/libtests/block13/init.c
+++ b/testsuites/libtests/block13/init.c
@@ -1,7 +1,7 @@
/* 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
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/block14/init.c b/testsuites/libtests/block14/init.c
index e3fe71e5da..ba0291d314 100644
--- a/testsuites/libtests/block14/init.c
+++ b/testsuites/libtests/block14/init.c
@@ -1,7 +1,7 @@
/* 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
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/block15/init.c b/testsuites/libtests/block15/init.c
index 4d8b48fc66..9409061631 100644
--- a/testsuites/libtests/block15/init.c
+++ b/testsuites/libtests/block15/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/block16/init.c b/testsuites/libtests/block16/init.c
index 883e1b05ea..d800895fee 100644
--- a/testsuites/libtests/block16/init.c
+++ b/testsuites/libtests/block16/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/block17/init.c b/testsuites/libtests/block17/init.c
index cedadfced8..bf670f679d 100644
--- a/testsuites/libtests/block17/init.c
+++ b/testsuites/libtests/block17/init.c
@@ -1,7 +1,7 @@
/* 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
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/crypt01/init.c b/testsuites/libtests/crypt01/init.c
index 26ba70e250..37966a0200 100644
--- a/testsuites/libtests/crypt01/init.c
+++ b/testsuites/libtests/crypt01/init.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2011 The FreeBSD Project. All rights reserved.
*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/defaultconfig01/init.c b/testsuites/libtests/defaultconfig01/init.c
index 1a5451fb09..b8d702c96f 100644
--- a/testsuites/libtests/defaultconfig01/init.c
+++ b/testsuites/libtests/defaultconfig01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/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/dl01/dl01-o1.c b/testsuites/libtests/dl01/dl01-o1.c
index ade4d5744d..9350235d85 100644
--- a/testsuites/libtests/dl01/dl01-o1.c
+++ b/testsuites/libtests/dl01/dl01-o1.c
@@ -29,7 +29,7 @@
* 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/dl02/dl02-o1.c b/testsuites/libtests/dl02/dl02-o1.c
index b442f82ae7..3b3e51825d 100644
--- a/testsuites/libtests/dl02/dl02-o1.c
+++ b/testsuites/libtests/dl02/dl02-o1.c
@@ -29,7 +29,7 @@
#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 02a537a84f..6694c5e985 100644
--- a/testsuites/libtests/dl02/dl02-o2.c
+++ b/testsuites/libtests/dl02/dl02-o2.c
@@ -27,7 +27,7 @@
#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/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/dl06/dl06-o1.c b/testsuites/libtests/dl06/dl06-o1.c
index 719d01e91f..1b8482bc3e 100644
--- a/testsuites/libtests/dl06/dl06-o1.c
+++ b/testsuites/libtests/dl06/dl06-o1.c
@@ -30,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 837c2e8e4f..0a46c027a8 100644
--- a/testsuites/libtests/dl06/dl06-o2.c
+++ b/testsuites/libtests/dl06/dl06-o2.c
@@ -30,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/dl07/dl-load.c b/testsuites/libtests/dl07/dl-load.c
index 58e3e06f78..2946120ca6 100644
--- a/testsuites/libtests/dl07/dl-load.c
+++ b/testsuites/libtests/dl07/dl-load.c
@@ -32,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/dl07-o1.c b/testsuites/libtests/dl07/dl07-o1.c
index 24a8086c49..0bca0ab838 100644
--- a/testsuites/libtests/dl07/dl07-o1.c
+++ b/testsuites/libtests/dl07/dl07-o1.c
@@ -28,7 +28,7 @@
#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 12cc917ae0..46aef0d6fe 100644
--- a/testsuites/libtests/dl07/dl07-o2.c
+++ b/testsuites/libtests/dl07/dl07-o2.c
@@ -29,7 +29,7 @@
#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 12a5fe6829..ab60f50e97 100644
--- a/testsuites/libtests/dl07/dl07-o3.c
+++ b/testsuites/libtests/dl07/dl07-o3.c
@@ -32,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 aeeb404561..e5f831ec24 100644
--- a/testsuites/libtests/dl07/dl07-o4.c
+++ b/testsuites/libtests/dl07/dl07-o4.c
@@ -29,7 +29,7 @@
#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 e487d072ae..83e98f6d9d 100644
--- a/testsuites/libtests/dl07/dl07-o5.c
+++ b/testsuites/libtests/dl07/dl07-o5.c
@@ -30,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/dl08/dl08-o1.c b/testsuites/libtests/dl08/dl08-o1.c
index ccd8bc3587..015e847ea2 100644
--- a/testsuites/libtests/dl08/dl08-o1.c
+++ b/testsuites/libtests/dl08/dl08-o1.c
@@ -28,7 +28,7 @@
#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 8d72cb8703..3833cb5768 100644
--- a/testsuites/libtests/dl08/dl08-o2.c
+++ b/testsuites/libtests/dl08/dl08-o2.c
@@ -29,7 +29,7 @@
#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 267895476c..dc839bf270 100644
--- a/testsuites/libtests/dl08/dl08-o3.c
+++ b/testsuites/libtests/dl08/dl08-o3.c
@@ -31,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 b77bf60465..d09fd2ec93 100644
--- a/testsuites/libtests/dl08/dl08-o4.c
+++ b/testsuites/libtests/dl08/dl08-o4.c
@@ -29,7 +29,7 @@
#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 614bff6a24..de86437757 100644
--- a/testsuites/libtests/dl08/dl08-o5.c
+++ b/testsuites/libtests/dl08/dl08-o5.c
@@ -30,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 3a03ec6e84..47d3f66f76 100644
--- a/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c
+++ b/testsuites/libtests/dl08/dl08-o6-123456789-123456789.c
@@ -29,7 +29,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/dl09/dl-load.c b/testsuites/libtests/dl09/dl-load.c
index 1de7c8fa29..216fb5a201 100644
--- a/testsuites/libtests/dl09/dl-load.c
+++ b/testsuites/libtests/dl09/dl-load.c
@@ -116,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)
@@ -152,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;
}
@@ -171,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/dl09-o1.c b/testsuites/libtests/dl09/dl09-o1.c
index 4659fda17c..291d33fcd0 100644
--- a/testsuites/libtests/dl09/dl09-o1.c
+++ b/testsuites/libtests/dl09/dl09-o1.c
@@ -28,7 +28,7 @@
#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 a6906b4ad9..e8976f3b49 100644
--- a/testsuites/libtests/dl09/dl09-o2.c
+++ b/testsuites/libtests/dl09/dl09-o2.c
@@ -29,7 +29,7 @@
#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 fab70c02c7..d9a056d45d 100644
--- a/testsuites/libtests/dl09/dl09-o3.c
+++ b/testsuites/libtests/dl09/dl09-o3.c
@@ -31,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 5cf4eb0f4b..8998059c93 100644
--- a/testsuites/libtests/dl09/dl09-o4.c
+++ b/testsuites/libtests/dl09/dl09-o4.c
@@ -29,7 +29,7 @@
#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 6b4aedbf68..e5374f3eb8 100644
--- a/testsuites/libtests/dl09/dl09-o5.c
+++ b/testsuites/libtests/dl09/dl09-o5.c
@@ -30,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/dl10/dl10-o1.c b/testsuites/libtests/dl10/dl10-o1.c
index ccd8bc3587..015e847ea2 100644
--- a/testsuites/libtests/dl10/dl10-o1.c
+++ b/testsuites/libtests/dl10/dl10-o1.c
@@ -28,7 +28,7 @@
#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 8d72cb8703..3833cb5768 100644
--- a/testsuites/libtests/dl10/dl10-o2.c
+++ b/testsuites/libtests/dl10/dl10-o2.c
@@ -29,7 +29,7 @@
#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 267895476c..dc839bf270 100644
--- a/testsuites/libtests/dl10/dl10-o3.c
+++ b/testsuites/libtests/dl10/dl10-o3.c
@@ -31,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 b77bf60465..d09fd2ec93 100644
--- a/testsuites/libtests/dl10/dl10-o4.c
+++ b/testsuites/libtests/dl10/dl10-o4.c
@@ -29,7 +29,7 @@
#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 35cfbda2cd..185c259d8c 100644
--- a/testsuites/libtests/dl10/dl10-o5.c
+++ b/testsuites/libtests/dl10/dl10-o5.c
@@ -29,7 +29,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-o6.c b/testsuites/libtests/dl10/dl10-o6.c
index fad9516f7b..2484ff6f2f 100644
--- a/testsuites/libtests/dl10/dl10-o6.c
+++ b/testsuites/libtests/dl10/dl10-o6.c
@@ -29,7 +29,6 @@
#include "dl-o5.h"
#include <inttypes.h>
-#include <rtems/test-info.h>
int rtems_main_o5 (void)
{
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/exit01/init.c b/testsuites/libtests/exit01/init.c
index df4beb15c3..0938cff025 100644
--- a/testsuites/libtests/exit01/init.c
+++ b/testsuites/libtests/exit01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2013 embedded brains GmbH. 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
diff --git a/testsuites/libtests/exit02/init.c b/testsuites/libtests/exit02/init.c
index 652464ab9b..8d8e43c173 100644
--- a/testsuites/libtests/exit02/init.c
+++ b/testsuites/libtests/exit02/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2013 embedded brains GmbH. 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
diff --git a/testsuites/libtests/exit03/init.c b/testsuites/libtests/exit03/init.c
index b761c0af4a..44acb35c6e 100644
--- a/testsuites/libtests/exit03/init.c
+++ b/testsuites/libtests/exit03/init.c
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2022 Chris Johns (Contemporary Software). All rights reserved.
- * Copyright (c) 2013 embedded brains GmbH. 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
diff --git a/testsuites/libtests/exit03/stdio.cc b/testsuites/libtests/exit03/stdio.cc
index 2a14089d01..09f2f1951c 100644
--- a/testsuites/libtests/exit03/stdio.cc
+++ b/testsuites/libtests/exit03/stdio.cc
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2022 Chris Johns (Contemporary Software). All rights reserved.
- * Copyright (c) 2013 embedded brains GmbH. 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
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, &region);
+ 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/init.c b/testsuites/libtests/flashdisk01/init.c
index 0caeb4e181..da9fc2a5b5 100644
--- a/testsuites/libtests/flashdisk01/init.c
+++ b/testsuites/libtests/flashdisk01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/flashdisk01/test-file-system.c b/testsuites/libtests/flashdisk01/test-file-system.c
index 66b18de273..f8c87fb8ad 100644
--- a/testsuites/libtests/flashdisk01/test-file-system.c
+++ b/testsuites/libtests/flashdisk01/test-file-system.c
@@ -1,7 +1,7 @@
/* 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
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/flashdisk01/test-file-system.h b/testsuites/libtests/flashdisk01/test-file-system.h
index 5bb5064246..b592ac7dca 100644
--- a/testsuites/libtests/flashdisk01/test-file-system.h
+++ b/testsuites/libtests/flashdisk01/test-file-system.h
@@ -1,7 +1,7 @@
/* 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
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/getentropy01/init.c b/testsuites/libtests/getentropy01/init.c
index 12f9741665..afdd0c88c1 100644
--- a/testsuites/libtests/getentropy01/init.c
+++ b/testsuites/libtests/getentropy01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2017 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2017 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/heapwalk/init.c b/testsuites/libtests/heapwalk/init.c
index d7f0302b0f..2864feac28 100644
--- a/testsuites/libtests/heapwalk/init.c
+++ b/testsuites/libtests/heapwalk/init.c
@@ -6,7 +6,7 @@
* 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
diff --git a/testsuites/libtests/i2c01/init.c b/testsuites/libtests/i2c01/init.c
index b6480fb99e..452bea4ac1 100644
--- a/testsuites/libtests/i2c01/init.c
+++ b/testsuites/libtests/i2c01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/irqs01/init.c b/testsuites/libtests/irqs01/init.c
index ab7ca926ca..604aaf1f22 100644
--- a/testsuites/libtests/irqs01/init.c
+++ b/testsuites/libtests/irqs01/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/libfdt01/init.c b/testsuites/libtests/libfdt01/init.c
index 80a8361339..6f369daf82 100644
--- a/testsuites/libtests/libfdt01/init.c
+++ b/testsuites/libtests/libfdt01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2015 embedded brains GmbH. 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
diff --git a/testsuites/libtests/libfdt01/some.dts b/testsuites/libtests/libfdt01/some.dts
index c6e2fc84ad..c4c7d926c6 100644
--- a/testsuites/libtests/libfdt01/some.dts
+++ b/testsuites/libtests/libfdt01/some.dts
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2015 embedded brains GmbH. 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
diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c
index 05d97a27d5..d72f49112e 100644
--- a/testsuites/libtests/malloctest/init.c
+++ b/testsuites/libtests/malloctest/init.c
@@ -4,7 +4,7 @@
* 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
@@ -60,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);
@@ -71,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);
@@ -84,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);
@@ -122,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 );
}
@@ -1528,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/md501/init.c b/testsuites/libtests/md501/init.c
index 00941acd85..e388f082b2 100644
--- a/testsuites/libtests/md501/init.c
+++ b/testsuites/libtests/md501/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/newlib01/init.c b/testsuites/libtests/newlib01/init.c
index 6edae3adbd..d3ccbddba1 100644
--- a/testsuites/libtests/newlib01/init.c
+++ b/testsuites/libtests/newlib01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2014, 2022 embedded brains GmbH. All rights reserved.
+ * Copyright (C) 2014, 2022 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/ofw01/some.dts b/testsuites/libtests/ofw01/some.dts
index e828622d02..6a5023414f 100644
--- a/testsuites/libtests/ofw01/some.dts
+++ b/testsuites/libtests/ofw01/some.dts
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2020 Niteesh G S <niteesh.gs@gmail.com>. All rights reserved.
- * Copyright (c) 2015 embedded brains GmbH. 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
diff --git a/testsuites/libtests/pwdgrp01/init.c b/testsuites/libtests/pwdgrp01/init.c
index 3420c8eafa..e241237272 100644
--- a/testsuites/libtests/pwdgrp01/init.c
+++ b/testsuites/libtests/pwdgrp01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/pwdgrp02/init.c b/testsuites/libtests/pwdgrp02/init.c
index 8a67ec1f53..3fb74b226c 100644
--- a/testsuites/libtests/pwdgrp02/init.c
+++ b/testsuites/libtests/pwdgrp02/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/rbheap01/init.c b/testsuites/libtests/rbheap01/init.c
index 34e7aacbb5..ab6d36ec34 100644
--- a/testsuites/libtests/rbheap01/init.c
+++ b/testsuites/libtests/rbheap01/init.c
@@ -1,7 +1,7 @@
/* 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
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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(&regulator, 0, sizeof(regulator));
+
+ sc = rtems_regulator_delete(&regulator, 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(&regulator, 0, sizeof(regulator));
+
+ sc = rtems_regulator_obtain_buffer(&regulator, &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(&regulator, 0, sizeof(regulator));
+
+ sc = rtems_regulator_release_buffer(&regulator, &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(&regulator, 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(&regulator, 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(&regulator, 0, sizeof(regulator));
+
+ sc = rtems_regulator_send(&regulator, 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, &regulator);
+ 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, &regulator);
+ 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, &regulator);
+ 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/sha/init.c b/testsuites/libtests/sha/init.c
index c65517253a..7d8c4ada3e 100644
--- a/testsuites/libtests/sha/init.c
+++ b/testsuites/libtests/sha/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2014 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,8 +29,11 @@
#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>
@@ -49,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,
@@ -74,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,
@@ -114,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;
@@ -133,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;
@@ -141,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);
@@ -156,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;
@@ -164,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);
@@ -179,12 +336,62 @@ 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();
diff --git a/testsuites/libtests/shell01/init.c b/testsuites/libtests/shell01/init.c
index 0fc29b8936..83564d9937 100644
--- a/testsuites/libtests/shell01/init.c
+++ b/testsuites/libtests/shell01/init.c
@@ -1,7 +1,7 @@
/* 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
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/sparsedisk01/init.c b/testsuites/libtests/sparsedisk01/init.c
index c756daa188..5398bf98ce 100644
--- a/testsuites/libtests/sparsedisk01/init.c
+++ b/testsuites/libtests/sparsedisk01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/spi01/init.c b/testsuites/libtests/spi01/init.c
index aeabdc04d0..7b68d0f76a 100644
--- a/testsuites/libtests/spi01/init.c
+++ b/testsuites/libtests/spi01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2016 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 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
diff --git a/testsuites/libtests/stackchk01/init.c b/testsuites/libtests/stackchk01/init.c
index 9e58409b17..b87b6baa2d 100644
--- a/testsuites/libtests/stackchk01/init.c
+++ b/testsuites/libtests/stackchk01/init.c
@@ -35,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();
@@ -50,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 5b3d9c894b..cbb9fb62f9 100644
--- a/testsuites/libtests/stackchk01/stackchk01.doc
+++ b/testsuites/libtests/stackchk01/stackchk01.doc
@@ -30,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/termios01/termios_testdriver.c b/testsuites/libtests/termios01/termios_testdriver.c
index d0a9534b52..49810a37e0 100644
--- a/testsuites/libtests/termios01/termios_testdriver.c
+++ b/testsuites/libtests/termios01/termios_testdriver.c
@@ -192,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/termios03/termios_testdriver_polled.c b/testsuites/libtests/termios03/termios_testdriver_polled.c
index a852fe1f20..8daf8d6685 100644
--- a/testsuites/libtests/termios03/termios_testdriver_polled.c
+++ b/testsuites/libtests/termios03/termios_testdriver_polled.c
@@ -159,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/termios04/termios_testdriver_impl.h b/testsuites/libtests/termios04/termios_testdriver_impl.h
index cfe9ebedf4..740f9e0778 100644
--- a/testsuites/libtests/termios04/termios_testdriver_impl.h
+++ b/testsuites/libtests/termios04/termios_testdriver_impl.h
@@ -271,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/termios09/init.c b/testsuites/libtests/termios09/init.c
index 3cb71fb267..a7c2518ecc 100644
--- a/testsuites/libtests/termios09/init.c
+++ b/testsuites/libtests/termios09/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2017 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2017 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/testsuites/libtests/ttest01/init.c b/testsuites/libtests/ttest01/init.c
index 658f8f6289..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
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 0a2f650ed2..5e30e6c203 100644
--- a/testsuites/libtests/ttest01/test-destructor.c
+++ b/testsuites/libtests/ttest01/test-destructor.c
@@ -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 e1f59876ca..3cc0f64d63 100644
--- a/testsuites/libtests/ttest01/test-fixture.c
+++ b/testsuites/libtests/ttest01/test-fixture.c
@@ -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 d7632b8590..0b8ccd4477 100644
--- a/testsuites/libtests/ttest01/test-plan.c
+++ b/testsuites/libtests/ttest01/test-plan.c
@@ -95,7 +95,7 @@ T_TEST_OUTPUT(nested_plan,
/*
* 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 4d540c9a86..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
diff --git a/testsuites/libtests/utf8proc01/init.c b/testsuites/libtests/utf8proc01/init.c
index 660459ae24..71a8936257 100644
--- a/testsuites/libtests/utf8proc01/init.c
+++ b/testsuites/libtests/utf8proc01/init.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012 embedded brains GmbH & Co. KG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions