[rtems commit] sptests/speventsystem01: Add test cases
Sebastian Huber
sebh at rtems.org
Sat Dec 22 15:44:21 UTC 2012
Module: rtems
Branch: master
Commit: 11c10b8ba1a2bad4e16d3fdb8ea40956c0735133
Changeset: http://git.rtems.org/rtems/commit/?id=11c10b8ba1a2bad4e16d3fdb8ea40956c0735133
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Sat Dec 22 16:48:45 2012 +0100
sptests/speventsystem01: Add test cases
---
testsuites/sptests/speventsystem01/init.c | 34 +++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/testsuites/sptests/speventsystem01/init.c b/testsuites/sptests/speventsystem01/init.c
index 4c919f7..2471101 100644
--- a/testsuites/sptests/speventsystem01/init.c
+++ b/testsuites/sptests/speventsystem01/init.c
@@ -77,12 +77,46 @@ static void test_with_timeout(void)
rtems_test_assert(sc == RTEMS_UNSATISFIED);
}
+static void test_with_invalid_receiver(void)
+{
+ rtems_status_code sc;
+
+ sc = rtems_event_system_send(0xffff, EVENT);
+ rtems_test_assert(sc == RTEMS_INVALID_ID);
+}
+
+static void test_with_invalid_address(void)
+{
+ rtems_status_code sc;
+
+ sc = rtems_event_system_receive(EVENT, RTEMS_NO_WAIT, 0, NULL);
+ rtems_test_assert(sc == RTEMS_INVALID_ADDRESS);
+}
+
+static void test_get_pending_events(void)
+{
+ rtems_status_code sc;
+ rtems_event_set out;
+
+ sc = rtems_event_system_receive(
+ RTEMS_PENDING_EVENTS,
+ RTEMS_NO_WAIT,
+ 0,
+ &out
+ );
+ rtems_test_assert(sc == RTEMS_SUCCESSFUL);
+ rtems_test_assert(out == 0);
+}
+
static void Init(rtems_task_argument arg)
{
puts("\n\n*** TEST SPEVENTSYSTEM 1 ***");
test_with_normal_and_system_event();
test_with_timeout();
+ test_with_invalid_receiver();
+ test_with_invalid_address();
+ test_get_pending_events();
puts("*** END OF TEST SPEVENTSYSTEM 1 ***");
More information about the vc
mailing list