test: fix test case for object detection task group 85/304885/1
authorInki Dae <inki.dae@samsung.com>
Thu, 25 Jan 2024 06:29:10 +0000 (15:29 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 25 Jan 2024 06:29:10 +0000 (15:29 +0900)
[issue type] : bug fix

Fix test case for object detection task group. In case of using
async API, destroy API can be called prior to exiting from waitforOutputQueue
function of AsyncManager class, and it can return a invalid operation exception.
Therefore, make sure to check the invalid operation exception so that
test case can be existed from user thread loop correctly.

Change-Id: I654a7123d6c88f40e6a17e55c2e374ff6c685017
Signed-off-by: Inki Dae <inki.dae@samsung.com>
test/testsuites/machine_learning/object_detection/test_object_detection_async.cpp

index 9cda1fcfd92352659ec68607f3604a61adef0af4..1b7721615834f97db499e5e5b1c09751422c6b4f 100644 (file)
@@ -53,6 +53,9 @@ void object_detection_callback(void *user_data)
                unsigned int number_of_objects;
 
                int ret = mv_object_detection_get_result_count(handle, &number_of_objects);
+               if (ret == MEDIA_VISION_ERROR_INVALID_OPERATION)
+                       break;
+
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                for (unsigned int idx = 0; idx < number_of_objects; ++idx) {
@@ -206,6 +209,9 @@ void face_detection_callback(void *user_data)
                unsigned int number_of_objects;
 
                int ret = mv_face_detection_get_result_count(handle, &number_of_objects);
+               if (ret == MEDIA_VISION_ERROR_INVALID_OPERATION)
+                       break;
+
                ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
 
                for (unsigned int idx = 0; idx < number_of_objects; ++idx) {