summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-05-19 08:06:01 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-05-19 08:09:26 +0200
commit976f208ff2247f9801dec4371327282edf2d5e98 (patch)
tree436d8aa9141f0b4ab3d35253f1a6901948862f08 /testsuites
parentvalidation: RTEMS_STATIC_ANALYSIS (diff)
downloadrtems-976f208ff2247f9801dec4371327282edf2d5e98.tar.bz2
validation: Add checks to static assert tests
This ensures that the test cases have at least one test step. Update #3716.
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/validation/tc-scheduler-non-smp.c39
-rw-r--r--testsuites/validation/tc-status.c24
2 files changed, 50 insertions, 13 deletions
diff --git a/testsuites/validation/tc-scheduler-non-smp.c b/testsuites/validation/tc-scheduler-non-smp.c
index d0353ebca0..7503c6880a 100644
--- a/testsuites/validation/tc-scheduler-non-smp.c
+++ b/testsuites/validation/tc-scheduler-non-smp.c
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2021, 2023 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
@@ -66,18 +66,22 @@
*
* This test case performs the following actions:
*
- * - Check that calling rtems_scheduler_get_processor() is a constant
- * expression which evaluates to zero.
+ * - Assert that rtems_scheduler_get_processor() is a constant expression which
+ * evaluates to zero.
+ *
+ * - Check that calling rtems_scheduler_get_processor() returns zero.
*
- * - Check that calling rtems_scheduler_get_processor_maximum() is a constant
+ * - Assert that rtems_scheduler_get_processor_maximum() is a constant
* expression which evaluates to zero.
*
+ * - Check that calling rtems_scheduler_get_processor_maximum() returns one.
+ *
* @{
*/
/**
- * @brief Check that calling rtems_scheduler_get_processor() is a constant
- * expression which evaluates to zero.
+ * @brief Assert that rtems_scheduler_get_processor() is a constant expression
+ * which evaluates to zero.
*/
static void RtemsSchedulerValNonSmp_Action_0( void )
{
@@ -85,11 +89,19 @@ static void RtemsSchedulerValNonSmp_Action_0( void )
}
/**
- * @brief Check that calling rtems_scheduler_get_processor_maximum() is a
- * constant expression which evaluates to zero.
+ * @brief Check that calling rtems_scheduler_get_processor() returns zero.
*/
static void RtemsSchedulerValNonSmp_Action_1( void )
{
+ T_eq_u32( rtems_scheduler_get_processor(), 0 );
+}
+
+/**
+ * @brief Assert that rtems_scheduler_get_processor_maximum() is a constant
+ * expression which evaluates to zero.
+ */
+static void RtemsSchedulerValNonSmp_Action_2( void )
+{
RTEMS_STATIC_ASSERT(
rtems_scheduler_get_processor_maximum() == 1,
GET_PROCESSOR_MAXIMUM
@@ -97,12 +109,23 @@ static void RtemsSchedulerValNonSmp_Action_1( void )
}
/**
+ * @brief Check that calling rtems_scheduler_get_processor_maximum() returns
+ * one.
+ */
+static void RtemsSchedulerValNonSmp_Action_3( void )
+{
+ T_eq_u32( rtems_scheduler_get_processor_maximum(), 1 );
+}
+
+/**
* @fn void T_case_body_RtemsSchedulerValNonSmp( void )
*/
T_TEST_CASE( RtemsSchedulerValNonSmp )
{
RtemsSchedulerValNonSmp_Action_0();
RtemsSchedulerValNonSmp_Action_1();
+ RtemsSchedulerValNonSmp_Action_2();
+ RtemsSchedulerValNonSmp_Action_3();
}
/** @} */
diff --git a/testsuites/validation/tc-status.c b/testsuites/validation/tc-status.c
index be706fa86f..3ac13f1253 100644
--- a/testsuites/validation/tc-status.c
+++ b/testsuites/validation/tc-status.c
@@ -7,7 +7,7 @@
*/
/*
- * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2021, 2023 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
@@ -67,12 +67,16 @@
*
* - Validate the status code constants.
*
- * - Check that RTEMS_STATUS_CODES_FIRST has the expected value and is a
+ * - Assert that RTEMS_STATUS_CODES_FIRST has the expected value and is a
* constant expression.
*
- * - Check that RTEMS_STATUS_CODES_LAST has the expected value and is a
+ * - Check that RTEMS_STATUS_CODES_FIRST has the expected value.
+ *
+ * - Assert that RTEMS_STATUS_CODES_LAST has the expected value and is a
* constant expression.
*
+ * - Check that RTEMS_STATUS_CODES_LAST has the expected value.
+ *
* @{
*/
@@ -84,16 +88,26 @@ static void RtemsStatusValStatus_Action_0( void )
/* Nothing to do */
/*
- * Check that RTEMS_STATUS_CODES_FIRST has the expected value and is a
+ * Assert that RTEMS_STATUS_CODES_FIRST has the expected value and is a
* constant expression.
*/
RTEMS_STATIC_ASSERT( RTEMS_STATUS_CODES_FIRST == 0, FIRST );
/*
- * Check that RTEMS_STATUS_CODES_LAST has the expected value and is a
+ * Check that RTEMS_STATUS_CODES_FIRST has the expected value.
+ */
+ T_eq_int( RTEMS_STATUS_CODES_FIRST, 0 );
+
+ /*
+ * Assert that RTEMS_STATUS_CODES_LAST has the expected value and is a
* constant expression.
*/
RTEMS_STATIC_ASSERT( RTEMS_STATUS_CODES_LAST == 29, LAST );
+
+ /*
+ * Check that RTEMS_STATUS_CODES_LAST has the expected value.
+ */
+ T_eq_int( RTEMS_STATUS_CODES_LAST, 29 );
}
/**