浏览代码

TC: code cleanup

Grissiom 11 年之前
父节点
当前提交
752fe135cd
共有 1 个文件被更改,包括 14 次插入23 次删除
  1. 14 23
      examples/kernel/tc_comm.c

+ 14 - 23
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);
-
-					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;
-					}
-				}
+                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;
+                }
 
                 if (_tc_stat & TC_STAT_FAILED)
                     rt_kprintf("TestCase[%s] failed\n", _tc_current);