summaryrefslogtreecommitdiff
path: root/testsuites/validation
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/validation')
-rw-r--r--testsuites/validation/tc-bsp-sparc-leon3.c248
-rw-r--r--testsuites/validation/ts-validation-dev-0.c73
2 files changed, 321 insertions, 0 deletions
diff --git a/testsuites/validation/tc-bsp-sparc-leon3.c b/testsuites/validation/tc-bsp-sparc-leon3.c
new file mode 100644
index 0000000000..8eb3fc1e95
--- /dev/null
+++ b/testsuites/validation/tc-bsp-sparc-leon3.c
@@ -0,0 +1,248 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestCaseBspSparcValGrlibIo
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (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 is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <dev/grlib/io.h>
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestCaseBspSparcValGrlibIo spec:/bsp/sparc/val/grlib-io
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesValidationDev0
+ *
+ * @brief Tests the SPARC-specific GRLIB API.
+ *
+ * This test case performs the following actions:
+ *
+ * - Call grlib_load_8() to load a prepared value.
+ *
+ * - Check that the returned value is equal to the prepared value.
+ *
+ * - Call grlib_load_16() to load a prepared value.
+ *
+ * - Check that the returned value is equal to the prepared value.
+ *
+ * - Call grlib_load_32() to load a prepared value.
+ *
+ * - Check that the returned value is equal to the prepared value.
+ *
+ * - Call grlib_load_64() to load a prepared value.
+ *
+ * - Check that the returned value is equal to the prepared value.
+ *
+ * - Call grlib_store_8() to store a value to an object.
+ *
+ * - Check that the value of the object is equal to the stored value.
+ *
+ * - Call grlib_store_16() to store a value to an object.
+ *
+ * - Check that the value of the object is equal to the stored value.
+ *
+ * - Call grlib_store_32() to store a value to an object.
+ *
+ * - Check that the value of the object is equal to the stored value.
+ *
+ * - Call grlib_store_64() to store a value to an object.
+ *
+ * - Check that the value of the object is equal to the stored value.
+ *
+ * @{
+ */
+
+/**
+ * @brief Call grlib_load_8() to load a prepared value.
+ */
+static void BspSparcValGrlibIo_Action_0( void )
+{
+ uint8_t reg_8;
+ uint8_t val_8;
+
+ reg_8 = 0x81;
+ val_8 = grlib_load_8( &reg_8 );
+
+ /*
+ * Check that the returned value is equal to the prepared value.
+ */
+ T_step_eq_u8( 0, val_8, 0x81 );
+}
+
+/**
+ * @brief Call grlib_load_16() to load a prepared value.
+ */
+static void BspSparcValGrlibIo_Action_1( void )
+{
+ uint16_t reg_16;
+ uint16_t val_16;
+
+ reg_16 = 0x8001;
+ val_16 = grlib_load_16( &reg_16 );
+
+ /*
+ * Check that the returned value is equal to the prepared value.
+ */
+ T_step_eq_u16( 1, val_16, 0x8001 );
+}
+
+/**
+ * @brief Call grlib_load_32() to load a prepared value.
+ */
+static void BspSparcValGrlibIo_Action_2( void )
+{
+ uint32_t reg_32;
+ uint32_t val_32;
+
+ reg_32 = 0x80000001;
+ val_32 = grlib_load_32( &reg_32 );
+
+ /*
+ * Check that the returned value is equal to the prepared value.
+ */
+ T_step_eq_u32( 2, val_32, 0x80000001 );
+}
+
+/**
+ * @brief Call grlib_load_64() to load a prepared value.
+ */
+static void BspSparcValGrlibIo_Action_3( void )
+{
+ uint64_t reg_64;
+ uint64_t val_64;
+
+ reg_64 = 0x8000000000000001;
+ val_64 = grlib_load_64( &reg_64 );
+
+ /*
+ * Check that the returned value is equal to the prepared value.
+ */
+ T_step_eq_u64( 3, val_64, 0x8000000000000001 );
+}
+
+/**
+ * @brief Call grlib_store_8() to store a value to an object.
+ */
+static void BspSparcValGrlibIo_Action_4( void )
+{
+ uint8_t reg_8;
+
+ grlib_store_8( &reg_8, 0x81 );
+
+ /*
+ * Check that the value of the object is equal to the stored value.
+ */
+ T_step_eq_u8( 4, reg_8, 0x81 );
+}
+
+/**
+ * @brief Call grlib_store_16() to store a value to an object.
+ */
+static void BspSparcValGrlibIo_Action_5( void )
+{
+ uint16_t reg_16;
+
+ grlib_store_16( &reg_16, 0x8001 );
+
+ /*
+ * Check that the value of the object is equal to the stored value.
+ */
+ T_step_eq_u16( 5, reg_16, 0x8001 );
+}
+
+/**
+ * @brief Call grlib_store_32() to store a value to an object.
+ */
+static void BspSparcValGrlibIo_Action_6( void )
+{
+ uint32_t reg_32;
+
+ grlib_store_32( &reg_32, 0x80000001 );
+
+ /*
+ * Check that the value of the object is equal to the stored value.
+ */
+ T_step_eq_u32( 6, reg_32, 0x80000001 );
+}
+
+/**
+ * @brief Call grlib_store_64() to store a value to an object.
+ */
+static void BspSparcValGrlibIo_Action_7( void )
+{
+ uint64_t reg_64;
+
+ grlib_store_64( &reg_64, 0x8000000000000001 );
+
+ /*
+ * Check that the value of the object is equal to the stored value.
+ */
+ T_step_eq_u64( 7, reg_64, 0x8000000000000001 );
+}
+
+/**
+ * @fn void T_case_body_BspSparcValGrlibIo( void )
+ */
+T_TEST_CASE( BspSparcValGrlibIo )
+{
+ T_plan( 8 );
+
+ BspSparcValGrlibIo_Action_0();
+ BspSparcValGrlibIo_Action_1();
+ BspSparcValGrlibIo_Action_2();
+ BspSparcValGrlibIo_Action_3();
+ BspSparcValGrlibIo_Action_4();
+ BspSparcValGrlibIo_Action_5();
+ BspSparcValGrlibIo_Action_6();
+ BspSparcValGrlibIo_Action_7();
+}
+
+/** @} */
diff --git a/testsuites/validation/ts-validation-dev-0.c b/testsuites/validation/ts-validation-dev-0.c
new file mode 100644
index 0000000000..0a68d21030
--- /dev/null
+++ b/testsuites/validation/ts-validation-dev-0.c
@@ -0,0 +1,73 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @ingroup RTEMSTestSuiteTestsuitesValidationDev0
+ */
+
+/*
+ * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (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 is part of the RTEMS quality process and was automatically
+ * generated. If you find something that needs to be fixed or
+ * worded better please post a report or patch to an RTEMS mailing list
+ * or raise a bug report:
+ *
+ * https://www.rtems.org/bugs.html
+ *
+ * For information on updating and regenerating please refer to the How-To
+ * section in the Software Requirements Engineering chapter of the
+ * RTEMS Software Engineering manual. The manual is provided as a part of
+ * a release. For development sources please refer to the online
+ * documentation at:
+ *
+ * https://docs.rtems.org
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/test.h>
+
+/**
+ * @defgroup RTEMSTestSuiteTestsuitesValidationDev0 \
+ * spec:/testsuites/validation-dev-0
+ *
+ * @ingroup RTEMSTestSuites
+ *
+ * @brief This general purpose validation test suite provides enough resources
+ * to run target-specific tests.
+ *
+ * @{
+ */
+
+const char rtems_test_name[] = "ValidationDev0";
+
+#include "ts-default.h"
+
+/** @} */