Fixing equals functions of list and intervalheap
This commit is contained in:
1 parent
0c8e12ce30
commit
101b839801
3 files changed
+12
-4
No files matched your search
@@ -798,11 +798,11 @@ struct cmc_callbacks_intervalheap
|
||||
V element1 = _heap1_->buffer[i / 2].data[i % 2]; \
|
||||
V element2 = _heap2_->buffer[i / 2].data[i % 2]; \
|
||||
\
|
||||
if (_heap1_->f_val->cmp(element1, element2) == 0) \
|
||||
return true; \
|
||||
if (_heap1_->f_val->cmp(element1, element2) != 0) \
|
||||
return false; \
|
||||
} \
|
||||
\
|
||||
return false; \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
struct cmc_string PFX##_to_string(struct SNAME *_heap_) \
|
||||
|
||||
+1
-1
@@ -867,7 +867,7 @@ struct cmc_callbacks_list
|
||||
return false; \
|
||||
} \
|
||||
\
|
||||
return false; \
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
struct cmc_string PFX##_to_string(struct SNAME *_list_) \
|
||||
|
||||
@@ -485,7 +485,15 @@ CMC_CREATE_UNIT(list_test, true, {
|
||||
cmc_assert_equals(int32_t, cmc_flags.OK, l_flag(l));
|
||||
cmc_assert_equals(int32_t, cmc_flags.OK, l_flag(l3));
|
||||
|
||||
// equals
|
||||
l->flag = cmc_flags.ERROR;
|
||||
l3->flag = cmc_flags.ERROR;
|
||||
cmc_assert(l_equals(l, l3));
|
||||
cmc_assert_equals(int32_t, cmc_flags.OK, l_flag(l));
|
||||
cmc_assert_equals(int32_t, cmc_flags.OK, l_flag(l3));
|
||||
|
||||
l_free(l);
|
||||
l_free(l2);
|
||||
l_free(l3);
|
||||
});
|
||||
})
|
||||
Reference in new issue
Block a user