aboutsummaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/integer_sequence_codec.cc5
-rw-r--r--src/decoder/partition.cc7
-rw-r--r--src/decoder/test/integer_sequence_codec_test.cc5
3 files changed, 9 insertions, 8 deletions
diff --git a/src/decoder/integer_sequence_codec.cc b/src/decoder/integer_sequence_codec.cc
index da7bc56..83c0359 100644
--- a/src/decoder/integer_sequence_codec.cc
+++ b/src/decoder/integer_sequence_codec.cc
@@ -14,6 +14,7 @@
#include "src/decoder/integer_sequence_codec.h"
#include "src/base/math_utils.h"
+#include "src/base/utils.h"
#include <algorithm>
#include <iostream>
@@ -383,8 +384,8 @@ void IntegerSequenceCodec::GetCountsForRange(
// These are generally errors -- there should never be any ASTC values
// outside of this range
- assert(range > 0);
- assert(range < 1 << kLog2MaxRangeForBits);
+ UTILS_RELEASE_ASSERT(range > 0);
+ UTILS_RELEASE_ASSERT(range < 1 << kLog2MaxRangeForBits);
*bits = 0;
*trits = 0;
diff --git a/src/decoder/partition.cc b/src/decoder/partition.cc
index 90d39fd..43ff6f0 100644
--- a/src/decoder/partition.cc
+++ b/src/decoder/partition.cc
@@ -14,6 +14,7 @@
#include "src/decoder/partition.h"
#include "src/base/bottom_n.h"
+#include "src/base/utils.h"
#include "src/decoder/footprint.h"
#include <algorithm>
@@ -399,12 +400,12 @@ constexpr int EncodeDims(int width, int height) {
int PartitionMetric(const Partition& a, const Partition& b) {
// Make sure that one partition is at least a subset of the other...
- assert(a.footprint == b.footprint);
+ UTILS_RELEASE_ASSERT(a.footprint == b.footprint);
// Make sure that the number of parts is within our limits. ASTC has a maximum
// of four subsets per block according to the specification.
- assert(a.num_parts <= kMaxNumSubsets);
- assert(b.num_parts <= kMaxNumSubsets);
+ UTILS_RELEASE_ASSERT(a.num_parts <= kMaxNumSubsets);
+ UTILS_RELEASE_ASSERT(b.num_parts <= kMaxNumSubsets);
const int w = a.footprint.Width();
const int h = b.footprint.Height();
diff --git a/src/decoder/test/integer_sequence_codec_test.cc b/src/decoder/test/integer_sequence_codec_test.cc
index b66ff2b..120e8b0 100644
--- a/src/decoder/test/integer_sequence_codec_test.cc
+++ b/src/decoder/test/integer_sequence_codec_test.cc
@@ -74,9 +74,8 @@ TEST(ASTCIntegerSequenceCodecTest, TestGetCountsForRange) {
EXPECT_EQ(b, kExpectedCounts[i - 1][2]);
}
- ASSERT_DEBUG_DEATH(IntegerSequenceCodec::GetCountsForRange(0, &t, &q, &b), "");
- ASSERT_DEBUG_DEATH(
- IntegerSequenceCodec::GetCountsForRange(256, &t, &q, &b), "");
+ ASSERT_DEATH(IntegerSequenceCodec::GetCountsForRange(0, &t, &q, &b), "");
+ ASSERT_DEATH(IntegerSequenceCodec::GetCountsForRange(256, &t, &q, &b), "");
IntegerSequenceCodec::GetCountsForRange(1, &t, &q, &b);
EXPECT_EQ(t, 0);