Add condition on assert in frame drop in datarate test.
It might not drop frames when dropping threshold is low so it can't be
used in the assertion.
Change-Id: Iadcf949178acad21f4453f59b7551e8c3d20c85e
diff --git a/test/datarate_test.cc b/test/datarate_test.cc
index 02943e6..f6bf7ff 100644
--- a/test/datarate_test.cc
+++ b/test/datarate_test.cc
@@ -212,10 +212,11 @@
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15)
<< " The datarate for the file is greater than target by too much!";
- ASSERT_LE(first_drop_, last_drop)
- << " The first dropped frame for drop_thresh " << i
- << " > first dropped frame for drop_thresh "
- << i - kDropFrameThreshTestStep;
+ if (last_drop > 0)
+ ASSERT_LE(first_drop_, last_drop)
+ << " The first dropped frame for drop_thresh " << i
+ << " > first dropped frame for drop_thresh "
+ << i - kDropFrameThreshTestStep;
ASSERT_GE(num_drops_, last_num_drops * 0.85)
<< " The number of dropped frames for drop_thresh " << i
<< " < number of dropped frames for drop_thresh "