소스 검색

Add correct sleeping behaviour

Ari 5 년 전
부모
커밋
5a06ca2471
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 7
      tests/server/check_subscription_events.c

+ 4 - 7
tests/server/check_subscription_events.c

@@ -261,7 +261,7 @@ START_TEST(generateEvents) {
 
     // let the client fetch the event and check if the correct values were received
     notificationReceived = false;
-    UA_fakeSleep((UA_UInt32) publishingInterval + 100);
+    UA_comboSleep((UA_UInt32) publishingInterval + 100);
     retval = UA_Client_run_iterate(client, 0);
     ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
     ck_assert_uint_eq(notificationReceived, true);
@@ -277,7 +277,7 @@ START_TEST(generateEvents) {
     UA_DeleteMonitoredItemsResponse deleteResponse =
         UA_Client_MonitoredItems_delete(client, deleteRequest);
 
-    UA_fakeSleep((UA_UInt32)publishingInterval + 100);
+    UA_realSleep((UA_UInt32)publishingInterval + 100);
     ck_assert_uint_eq(deleteResponse.responseHeader.serviceResult, UA_STATUSCODE_GOOD);
     ck_assert_uint_eq(deleteResponse.resultsSize, 1);
     ck_assert_uint_eq(*(deleteResponse.results), UA_STATUSCODE_GOOD);
@@ -348,7 +348,7 @@ START_TEST(uppropagation) {
 
     // let the client fetch the event and check if the correct values were received
     notificationReceived = false;
-    UA_fakeSleep((UA_UInt32) publishingInterval + 100);
+    UA_comboSleep((UA_UInt32) publishingInterval + 100);
     retval = UA_Client_run_iterate(client, 0);
     ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
     ck_assert_uint_eq(notificationReceived, true);
@@ -408,7 +408,7 @@ START_TEST(eventOverflow) {
     // fetch the events, ensure both the overflow and the original event are received
     notificationReceived = false;
     overflowNotificationReceived = true;
-    UA_fakeSleep((UA_UInt32) publishingInterval + 100);
+    UA_comboSleep((UA_UInt32) publishingInterval + 100);
     retval = UA_Client_run_iterate(client, 0);
     ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
     ck_assert_uint_eq(notificationReceived, true);
@@ -476,8 +476,6 @@ START_TEST(multipleMonitoredItemsOneNode) {
         ck_assert_uint_eq(deleteResponse.resultsSize, 1);
         ck_assert_uint_eq(*(deleteResponse.results), UA_STATUSCODE_GOOD);
         UA_DeleteMonitoredItemsResponse_deleteMembers(&deleteResponse);
-
-        UA_fakeSleep((UA_UInt32) publishingInterval + 100);
     }
 } END_TEST
 
@@ -497,7 +495,6 @@ START_TEST(eventStressing) {
                                             UA_NODEID_NUMERIC(0, UA_NS0ID_SERVER), NULL, UA_FALSE);
             ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
         }
-        UA_fakeSleep((UA_UInt32)publishingInterval + 100);
         retval = UA_Client_run_iterate(client, 0);
         ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
     }