summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAngie Chiang <angiebird@google.com>2018-11-20 15:08:11 -0800
committerAngie Chiang <angiebird@google.com>2018-11-20 15:08:44 -0800
commitab5c8ff8a016153f9a6c03a9c0367a7910dbbc20 (patch)
treeed074f9f7f812791665f8661d113fbab335d9038 /test
parent3c51b91f378b22c299f0a57e3d4ae603279e1b3c (diff)
downloadlibvpx-ab5c8ff8a016153f9a6c03a9c0367a7910dbbc20.tar
libvpx-ab5c8ff8a016153f9a6c03a9c0367a7910dbbc20.tar.gz
libvpx-ab5c8ff8a016153f9a6c03a9c0367a7910dbbc20.tar.bz2
libvpx-ab5c8ff8a016153f9a6c03a9c0367a7910dbbc20.zip
Replace assert by ASSERT_TRUE
BUG=webm:1575 Change-Id: Id47930b48733159f5e967dc5fd1205e501b635b9
Diffstat (limited to 'test')
-rw-r--r--test/comp_avg_pred_test.cc9
-rw-r--r--test/idct_test.cc72
-rw-r--r--test/temporal_filter_test.cc8
3 files changed, 40 insertions, 49 deletions
diff --git a/test/comp_avg_pred_test.cc b/test/comp_avg_pred_test.cc
index 6d658cbec..56e701e09 100644
--- a/test/comp_avg_pred_test.cc
+++ b/test/comp_avg_pred_test.cc
@@ -29,11 +29,10 @@ uint8_t avg_with_rounding(uint8_t a, uint8_t b) { return (a + b + 1) >> 1; }
void reference_pred(const Buffer<uint8_t> &pred, const Buffer<uint8_t> &ref,
int width, int height, Buffer<uint8_t> *avg) {
- if (avg->TopLeftPixel() == NULL || pred.TopLeftPixel() == NULL ||
- ref.TopLeftPixel() == NULL) {
- assert(0);
- return;
- }
+ ASSERT_TRUE(avg->TopLeftPixel() != NULL);
+ ASSERT_TRUE(pred.TopLeftPixel() != NULL);
+ ASSERT_TRUE(ref.TopLeftPixel() != NULL);
+
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
avg->TopLeftPixel()[y * avg->stride() + x] =
diff --git a/test/idct_test.cc b/test/idct_test.cc
index e3d1c9ecc..3564c0bd5 100644
--- a/test/idct_test.cc
+++ b/test/idct_test.cc
@@ -72,57 +72,51 @@ TEST_P(IDCTTest, TestAllZeros) {
TEST_P(IDCTTest, TestAllOnes) {
input->Set(0);
- if (input->TopLeftPixel() != NULL) {
- // When the first element is '4' it will fill the output buffer with '1'.
- input->TopLeftPixel()[0] = 4;
- predict->Set(0);
- output->Set(0);
-
- ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(),
- predict->stride(), output->TopLeftPixel(),
- output->stride()));
-
- ASSERT_TRUE(output->CheckValues(1));
- ASSERT_TRUE(output->CheckPadding());
- } else {
- assert(0);
- }
+ ASSERT_TRUE(input->TopLeftPixel() != NULL);
+ // When the first element is '4' it will fill the output buffer with '1'.
+ input->TopLeftPixel()[0] = 4;
+ predict->Set(0);
+ output->Set(0);
+
+ ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(),
+ predict->stride(), output->TopLeftPixel(),
+ output->stride()));
+
+ ASSERT_TRUE(output->CheckValues(1));
+ ASSERT_TRUE(output->CheckPadding());
}
TEST_P(IDCTTest, TestAddOne) {
// Set the transform output to '1' and make sure it gets added to the
// prediction buffer.
input->Set(0);
- if (input->TopLeftPixel() != NULL) {
- input->TopLeftPixel()[0] = 4;
- output->Set(0);
-
- uint8_t *pred = predict->TopLeftPixel();
- for (int y = 0; y < 4; ++y) {
- for (int x = 0; x < 4; ++x) {
- pred[y * predict->stride() + x] = y * 4 + x;
- }
- }
-
- ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(),
- predict->stride(), output->TopLeftPixel(),
- output->stride()));
+ ASSERT_TRUE(input->TopLeftPixel() != NULL);
+ input->TopLeftPixel()[0] = 4;
+ output->Set(0);
- uint8_t const *out = output->TopLeftPixel();
- for (int y = 0; y < 4; ++y) {
- for (int x = 0; x < 4; ++x) {
- EXPECT_EQ(1 + y * 4 + x, out[y * output->stride() + x]);
- }
+ uint8_t *pred = predict->TopLeftPixel();
+ for (int y = 0; y < 4; ++y) {
+ for (int x = 0; x < 4; ++x) {
+ pred[y * predict->stride() + x] = y * 4 + x;
}
+ }
+
+ ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(),
+ predict->stride(), output->TopLeftPixel(),
+ output->stride()));
- if (HasFailure()) {
- output->DumpBuffer();
+ uint8_t const *out = output->TopLeftPixel();
+ for (int y = 0; y < 4; ++y) {
+ for (int x = 0; x < 4; ++x) {
+ EXPECT_EQ(1 + y * 4 + x, out[y * output->stride() + x]);
}
+ }
- ASSERT_TRUE(output->CheckPadding());
- } else {
- assert(0);
+ if (HasFailure()) {
+ output->DumpBuffer();
}
+
+ ASSERT_TRUE(output->CheckPadding());
}
TEST_P(IDCTTest, TestWithData) {
diff --git a/test/temporal_filter_test.cc b/test/temporal_filter_test.cc
index b01f8ad2e..d14a4826e 100644
--- a/test/temporal_filter_test.cc
+++ b/test/temporal_filter_test.cc
@@ -45,11 +45,9 @@ void reference_filter(const Buffer<uint8_t> &a, const Buffer<uint8_t> &b, int w,
rounding = 1 << (filter_strength - 1);
}
- if (a.TopLeftPixel() == NULL || b.TopLeftPixel() == NULL ||
- diff_sq.TopLeftPixel() == NULL) {
- assert(0);
- return;
- }
+ ASSERT_TRUE(a.TopLeftPixel() != NULL);
+ ASSERT_TRUE(b.TopLeftPixel() != NULL);
+ ASSERT_TRUE(diff_sq.TopLeftPixel() != NULL);
// Calculate all the differences. Avoids re-calculating a bunch of extra
// values.
for (int height = 0; height < h; ++height) {