You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/08/24 00:53:33 UTC

[19/50] [abbrv] incubator-mynewt-core git commit: fixing

fixing


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/6e96e267
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/6e96e267
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/6e96e267

Branch: refs/heads/master
Commit: 6e96e26732cdda69e613553c7d1d5f093f26dc42
Parents: 6181514
Author: NgesBrian <ng...@gmail.com>
Authored: Mon Aug 15 23:34:51 2016 +0100
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Thu Aug 18 09:20:59 2016 -0700

----------------------------------------------------------------------
 libs/os/src/test/callout_test.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/6e96e267/libs/os/src/test/callout_test.c
----------------------------------------------------------------------
diff --git a/libs/os/src/test/callout_test.c b/libs/os/src/test/callout_test.c
index a56efd5..4e3811d 100644
--- a/libs/os/src/test/callout_test.c
+++ b/libs/os/src/test/callout_test.c
@@ -121,6 +121,7 @@ callout_task_receive( void *arg)
 {
     int i;
     struct os_event *event;
+    struct os_callout_func *callout;
     os_time_t now;
     os_time_t tm;
     os_sr_t sr; 
@@ -128,6 +129,8 @@ callout_task_receive( void *arg)
     event = os_eventq_poll(&callout_func_test.cf_c.c_evq, 1, OS_WAIT_FOREVER);
     TEST_ASSERT(event->ev_type ==  OS_EVENT_T_TIMER);
     TEST_ASSERT(event->ev_arg == NULL);
+    callout = (struct os_callout_func *)event;
+    TEST_ASSERT(callout->cf_func == my_callout_func);
 
     /* Should say whether callout is armed or not */
     i = os_callout_queued(&callout_func_test.cf_c);
@@ -177,12 +180,16 @@ callout_task_stop_receive( void *arg )
 {
     int k;
     struct os_event *event;
+    struct os_callout_func *callout;
     /* Recieving using the os_eventq_poll */
     for(k=0; k<MULTI_SIZE; k++){
         event = os_eventq_poll(&callout_func_stop_test[k].cf_c.c_evq, 1,
            OS_WAIT_FOREVER);
         TEST_ASSERT(event->ev_type ==  OS_EVENT_T_TIMER);
         TEST_ASSERT(event->ev_arg == NULL);
+        callout = (struct os_callout_func *)event;
+        TEST_ASSERT(callout->cf_func == my_callout_stop_func);
+
 
      }
      
@@ -221,8 +228,13 @@ callout_task_stop_speak( void *arg )
 void
 callout_task_stop_listen( void *arg )
 {
-    os_eventq_get(callout_func_speak.cf_c.c_evq);
+    struct os_event *event;
+    struct os_callout_func *callout;
+    event = os_eventq_get(callout_func_speak.cf_c.c_evq);
     TEST_ASSERT_FATAL(0);
+    callout = (struct os_callout_func *)event;
+    TEST_ASSERT(callout->cf_func == my_callout_speak_func);
+
 }
 
 /* Test case to test the basics of the callout */
@@ -247,11 +259,9 @@ TEST_CASE(callout_test)
     /* Initialize the callout function */
     os_callout_func_init(&callout_func_test, &callout_evq,
         my_callout_func, NULL);
-    TEST_ASSERT(p == 4);
 
     /* Does not return until OS_restart is called */
     os_start();
-
 }
 
 /* Test case of the callout_task_stop */
@@ -279,8 +289,6 @@ TEST_CASE(callout_test_stop)
     for(k = 0; k<MULTI_SIZE; k++){
         os_callout_func_init(&callout_func_stop_test[k], &callout_stop_evq[k],
            my_callout_stop_func, NULL);
-         TEST_ASSERT(q == 1);
-
     }
 
     /* Does not return until OS_restart is called */
@@ -308,9 +316,7 @@ TEST_CASE(callout_test_speak)
     
     /* Initialize the callout function */
     os_callout_func_init(&callout_func_speak, &callout_evq,
-        my_callout_speak_func, NULL);
-    TEST_ASSERT(t == 2);
-    
+        my_callout_speak_func, NULL);    
     /* Does not return until OS_restart is called */
     os_start();