tc: erase assert
authorJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 8 Feb 2021 09:44:31 +0000 (18:44 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 8 Feb 2021 09:44:34 +0000 (18:44 +0900)
Change-Id: I30f90d157ed25c898ff623661730d68947b534bd
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
haltests/src/tc_tdm_output.cpp

index 764d63e..193b2ce 100644 (file)
@@ -330,9 +330,9 @@ tc_tdm_output_get_vblank_interval_time(tdm_output *output)
        const tdm_output_mode *mode = (const tdm_output_mode *)TDM_UT_INVALID_VALUE;
        tdm_error ret = tdm_output_get_mode(output, &mode);
 
-       assert(ret == TDM_ERROR_NONE);
-       assert(mode != NULL);
-       assert(mode->vrefresh > 0);
+       if (ret != TDM_ERROR_NONE) return -1;
+       if (mode == NULL) return -1;
+       if (mode->vrefresh == 0) return -1;
 
        return (double)1.0 / (double)mode->vrefresh;
 }
@@ -1261,6 +1261,7 @@ TEST_P(TDMOutput, OutputWaitVblank)
                        double start, end, interval;
 
                        interval = tc_tdm_output_get_vblank_interval_time(outputs[o]);
+                       EXPECT_NE(interval, -1);
 
                        done1 = false;
                        start = tdm_helper_get_time();
@@ -1337,6 +1338,7 @@ TEST_P(TDMOutput, OutputWaitVblankInterval)
                        double start, end, interval;
 
                        interval = tc_tdm_output_get_vblank_interval_time(outputs[o]);
+                       EXPECT_NE(interval, -1);
 
                        done1 = false;
                        start = tdm_helper_get_time();
@@ -1367,6 +1369,7 @@ TEST_P(TDMOutput, OutputWaitVblankFewTimesInOneVblank)
                        double start, end, interval;
 
                        interval = tc_tdm_output_get_vblank_interval_time(outputs[o]);
+                       EXPECT_NE(interval, -1);
 
                        done1 = done2 = done3 = false;
                        EXPECT_EQ(tdm_output_wait_vblank(outputs[o], t, 0, _tc_tdm_output_done_cb, &done1), TDM_ERROR_NONE);
@@ -1504,6 +1507,7 @@ TEST_P(TDMOutput, OutputCommit)
                        double start, end, interval;
 
                        interval = tc_tdm_output_get_vblank_interval_time(outputs[o]);
+                       EXPECT_NE(interval, -1);
 
                        done1 = false;
                        start = tdm_helper_get_time();