You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2016/05/02 21:04:22 UTC
[3/4] lucy git commit: Switch test macro from signed to unsigned.
Switch test macro from signed to unsigned.
Use TEST_UINT_EQ instead of TEST_INT_EQ as needed.
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/bbac126a
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/bbac126a
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/bbac126a
Branch: refs/heads/master
Commit: bbac126ab9d815d8519dfe3f008db572a3ea4305
Parents: 2d6629e
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Apr 26 15:43:31 2016 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Tue Apr 26 18:20:29 2016 -0700
----------------------------------------------------------------------
core/Lucy/Test/Index/TestPolyReader.c | 2 +-
core/Lucy/Test/Util/TestMemoryPool.c | 12 ++++++------
core/Lucy/Test/Util/TestNumberUtils.c | 12 ++++++------
3 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/bbac126a/core/Lucy/Test/Index/TestPolyReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Index/TestPolyReader.c b/core/Lucy/Test/Index/TestPolyReader.c
index 44a99a9..91ebd98 100644
--- a/core/Lucy/Test/Index/TestPolyReader.c
+++ b/core/Lucy/Test/Index/TestPolyReader.c
@@ -40,7 +40,7 @@ test_sub_tick(TestBatchRunner *runner) {
for (i = 1; i < num_segs; i++) {
if (PolyReader_sub_tick(offsets, i) != i - 1) { break; }
}
- TEST_INT_EQ(runner, i, num_segs, "got all sub_tick() calls right");
+ TEST_UINT_EQ(runner, i, num_segs, "got all sub_tick() calls right");
DECREF(offsets);
FREEMEM(ints);
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/bbac126a/core/Lucy/Test/Util/TestMemoryPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestMemoryPool.c b/core/Lucy/Test/Util/TestMemoryPool.c
index 02b2ac7..7e960ab 100644
--- a/core/Lucy/Test/Util/TestMemoryPool.c
+++ b/core/Lucy/Test/Util/TestMemoryPool.c
@@ -39,11 +39,11 @@ TestMemPool_Run_IMP(TestMemoryPool *self, TestBatchRunner *runner) {
ptr_a = (char*)MemPool_Grab(mem_pool, 10);
size_t expected = sizeof(void*) == 8 ? 16 : 12;
- TEST_INT_EQ(runner, MemPool_Get_Consumed(mem_pool), expected,
- "Round up allocation to word size");
+ TEST_UINT_EQ(runner, MemPool_Get_Consumed(mem_pool), expected,
+ "Round up allocation to word size");
ptr_b = (char*)MemPool_Grab(mem_pool, 10);
- TEST_INT_EQ(runner, MemPool_Get_Consumed(mem_pool), expected * 2,
- "Accumulate consumed.");
+ TEST_UINT_EQ(runner, MemPool_Get_Consumed(mem_pool), expected * 2,
+ "Accumulate consumed.");
ptr_a = ivars->buf;
MemPool_Resize(mem_pool, ptr_b, 6);
@@ -52,8 +52,8 @@ TestMemPool_Run_IMP(TestMemoryPool *self, TestBatchRunner *runner) {
"Resize() adjusts `consumed`");
MemPool_Release_All(mem_pool);
- TEST_INT_EQ(runner, MemPool_Get_Consumed(mem_pool), 0,
- "Release_All() resets `consumed`");
+ TEST_UINT_EQ(runner, MemPool_Get_Consumed(mem_pool), 0,
+ "Release_All() resets `consumed`");
DECREF(mem_pool);
}
http://git-wip-us.apache.org/repos/asf/lucy/blob/bbac126a/core/Lucy/Test/Util/TestNumberUtils.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestNumberUtils.c b/core/Lucy/Test/Util/TestNumberUtils.c
index 58b60e2..0835b08 100644
--- a/core/Lucy/Test/Util/TestNumberUtils.c
+++ b/core/Lucy/Test/Util/TestNumberUtils.c
@@ -167,8 +167,8 @@ test_cu32(TestBatchRunner *runner) {
decode = encoded;
skip = encoded;
for (size_t i = 0; i < count; i++) {
- TEST_INT_EQ(runner, NumUtil_decode_cu32(&decode), ints[i],
- "cu32 %lu", (long)ints[i]);
+ TEST_UINT_EQ(runner, NumUtil_decode_cu32(&decode), ints[i],
+ "cu32 %lu", (unsigned long)ints[i]);
NumUtil_skip_cint(&skip);
if (decode > limit) { THROW(ERR, "overrun"); }
}
@@ -185,8 +185,8 @@ test_cu32(TestBatchRunner *runner) {
decode = encoded;
skip = encoded;
for (size_t i = 0; i < count; i++) {
- TEST_INT_EQ(runner, NumUtil_decode_cu32(&decode), ints[i],
- "padded cu32 %lu", (long)ints[i]);
+ TEST_UINT_EQ(runner, NumUtil_decode_cu32(&decode), ints[i],
+ "padded cu32 %lu", (unsigned long)ints[i]);
NumUtil_skip_cint(&skip);
if (decode > limit) { THROW(ERR, "overrun"); }
}
@@ -197,7 +197,7 @@ test_cu32(TestBatchRunner *runner) {
target = encoded;
NumUtil_encode_cu32(UINT32_MAX, &target);
decode = encoded;
- TEST_INT_EQ(runner, NumUtil_decode_cu32(&decode), UINT32_MAX, "cu32 UINT32_MAX");
+ TEST_UINT_EQ(runner, NumUtil_decode_cu32(&decode), UINT32_MAX, "cu32 UINT32_MAX");
FREEMEM(encoded);
FREEMEM(ints);
@@ -346,7 +346,7 @@ test_bigend_u32(TestBatchRunner *runner) {
target = encoded;
for (size_t i = 0; i < count; i++) {
uint32_t got = NumUtil_decode_bigend_u32(target);
- TEST_INT_EQ(runner, got, ints[i], "bigend u32");
+ TEST_UINT_EQ(runner, got, ints[i], "bigend u32");
target += sizeof(uint32_t);
}