aboutsummaryrefslogtreecommitdiff
path: root/src/test/modules/test_integerset/test_integerset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/modules/test_integerset/test_integerset.c')
-rw-r--r--src/test/modules/test_integerset/test_integerset.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/modules/test_integerset/test_integerset.c b/src/test/modules/test_integerset/test_integerset.c
index 0bb6d47f4b1..32713f4baa1 100644
--- a/src/test/modules/test_integerset/test_integerset.c
+++ b/src/test/modules/test_integerset/test_integerset.c
@@ -590,12 +590,14 @@ test_huge_distances(void)
for (int i = 0; i < num_values; i++)
{
uint64 x = values[i];
+ bool expected;
bool result;
if (x > 0)
{
+ expected = (values[i - 1] == x - 1);
result = intset_is_member(intset, x - 1);
- if (result != false)
+ if (result != expected)
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x - 1);
}
@@ -603,8 +605,9 @@ test_huge_distances(void)
if (result != true)
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x);
+ expected = (i != num_values - 1) ? (values[i + 1] == x + 1) : false;
result = intset_is_member(intset, x + 1);
- if (result != false)
+ if (result != expected)
elog(ERROR, "intset_is_member failed for " UINT64_FORMAT, x + 1);
}