Test/Fix Compiler Warning (else ambiguity)
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 13 Dec 2019 06:59:00 +0000 (15:59 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 13 Dec 2019 08:56:28 +0000 (17:56 +0900)
Probably because of GTest macros, having if statement around
EXPECT_* appears to be not a good approach if it is not bracketed.

Fix compiler warnings from such.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
tests/tizen_capi/unittest_tizen_capi.cpp

index 62f9f90..854eb11 100644 (file)
@@ -2261,15 +2261,17 @@ single_shot_loop_test (void *arg)
 
   status = ml_single_open (&single, ss_data->test_model, NULL, NULL,
       ML_NNFW_TYPE_TENSORFLOW_LITE, ML_NNFW_HW_ANY);
-  if (ss_data->expect)
+  if (ss_data->expect) {
     EXPECT_EQ (status, ML_ERROR_NONE);
+  }
   ss_data->single = &single;
 
   /* set timeout */
   if (ss_data->timeout != 0) {
     status = ml_single_set_timeout (single, ss_data->timeout);
-    if (ss_data->expect)
+    if (ss_data->expect) {
       EXPECT_NE (status, ML_ERROR_INVALID_PARAMETER);
+    }
     if (status == ML_ERROR_NOT_SUPPORTED)
       ss_data->timeout = 0;
   }
@@ -2318,8 +2320,9 @@ single_shot_loop_test (void *arg)
   ml_tensors_info_destroy (in_info);
 
   status = ml_single_close (single);
-  if (ss_data->expect)
+  if (ss_data->expect) {
     EXPECT_EQ (status, ML_ERROR_NONE);
+  }
 
   return NULL;
 }