summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrissiom <[email protected]>2013-12-18 22:21:31 +0800
committerGrissiom <[email protected]>2013-12-18 22:21:31 +0800
commit752fe135cd695ef93a630dbd1c361470c95de724 (patch)
tree6cbd7353674ae0e550befc92206481448f7ba2dc
parentb66c5ee0744ecf0c37785f8aa96c3d7c9cc78e89 (diff)
TC: code cleanup
-rw-r--r--examples/kernel/tc_comm.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/examples/kernel/tc_comm.c b/examples/kernel/tc_comm.c
index 1a62de6263..7804701284 100644
--- a/examples/kernel/tc_comm.c
+++ b/examples/kernel/tc_comm.c
@@ -37,29 +37,20 @@ void tc_thread_entry(void* parameter)
_tc_current = index->name + 4;
rt_kprintf("Run TestCase: %s\n", _tc_current);
_tc_stat = TC_STAT_PASSED | TC_STAT_RUNNING;
- tick = index->func();
- if (tick > 0)
- {
- /* Make sure we are going to be blocked. */
- rt_sem_control(&_tc_sem, RT_IPC_CMD_RESET, 0);
- rt_sem_take(&_tc_sem, tick * _tc_scale);
+ tick = index->func();
+ if (tick > 0)
+ {
+ /* Make sure we are going to be blocked. */
+ rt_sem_control(&_tc_sem, RT_IPC_CMD_RESET, 0);
+ rt_sem_take(&_tc_sem, tick * _tc_scale);
+ }
- if (_tc_cleanup != RT_NULL)
- {
- /* perform testcase cleanup */
- _tc_cleanup();
- _tc_cleanup = RT_NULL;
- }
- }
- else
- {
- if (_tc_cleanup != RT_NULL)
- {
- /* perform testcase cleanup */
- _tc_cleanup();
- _tc_cleanup = RT_NULL;
- }
- }
+ if (_tc_cleanup != RT_NULL)
+ {
+ /* perform testcase cleanup */
+ _tc_cleanup();
+ _tc_cleanup = RT_NULL;
+ }
if (_tc_stat & TC_STAT_FAILED)
rt_kprintf("TestCase[%s] failed\n", _tc_current);