aboutsummaryrefslogtreecommitdiffstats
path: root/test/testsem.c
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-07 14:34:59 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-06-07 14:34:59 +0000
commit5cad241306f64d0a3c0f7829421e4bf8f4b18fbe (patch)
treeebbcad6d0cdb19fa5ef0bf5f6dc5cf80dfbdc4d1 /test/testsem.c
parent152f34a80c6ffe5fd17809732272823091b854e8 (diff)
parentaec912f13f9aa85cd677353fa556f679c3832970 (diff)
downloadChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.tar.gz
ChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.tar.bz2
ChibiOS-5cad241306f64d0a3c0f7829421e4bf8f4b18fbe.zip
I2C. Merged code from trunk.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/i2c_dev@3036 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/testsem.c')
-rw-r--r--test/testsem.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/testsem.c b/test/testsem.c
index 25d87f3f1..6a6a622ef 100644
--- a/test/testsem.c
+++ b/test/testsem.c
@@ -1,5 +1,6 @@
/*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -50,7 +51,7 @@
* @brief Semaphores test header file
*/
-#if CH_USE_SEMAPHORES
+#if CH_USE_SEMAPHORES || defined(__DOXYGEN__)
#define ALLOWED_DELAY MS2ST(5)
@@ -103,9 +104,9 @@ static void sem1_execute(void) {
test_assert_sequence(1, "ABCDE");
#endif
threads[0] = chThdCreateStatic(wa[0], WA_SIZE, chThdGetPriority()+5, thread1, "A");
- chSemSetCounterI(&sem1, 2);
+ chSemAddCounterI(&sem1, 2);
test_wait_threads();
- test_assert(2, chSemGetCounterI(&sem1) == 2, "invalid counter");
+ test_assert(2, chSemGetCounterI(&sem1) == 1, "invalid counter");
}
ROMCONST struct testcase testsem1 = {
@@ -189,7 +190,7 @@ ROMCONST struct testcase testsem2 = {
sem2_execute
};
-#if CH_USE_SEMSW
+#if CH_USE_SEMSW || defined(__DOXYGEN__)
/**
* @page test_sem_003 Atomic signal-wait test
*
@@ -291,10 +292,10 @@ ROMCONST struct testcase testsem4 = {
* @brief Test sequence for semaphores.
*/
ROMCONST struct testcase * ROMCONST patternsem[] = {
-#if CH_USE_SEMAPHORES
+#if CH_USE_SEMAPHORES || defined(__DOXYGEN__)
&testsem1,
&testsem2,
-#if CH_USE_SEMSW
+#if CH_USE_SEMSW || defined(__DOXYGEN__)
&testsem3,
#endif
&testsem4,