dlck_vos_cont_recs_get_active() unit tests#30
Conversation
Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
|
Errors are component not formatted correctly,Ticket number prefix incorrect,PR title is malformatted. See https://daosio.atlassian.net/wiki/spaces/DC/pages/11133911069/Commit+Comments,Unable to load ticket data |
osalyk
left a comment
There was a problem hiding this comment.
Reviewed 8 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @janekmi)
src/utils/dlck/tests/dlck_vos_cont_recs_get_active_ut.c line 88 at r1 (raw file):
assert_ptr_equal(dv, DV_MOCK); return mock_type(int); }
Macros or maybe aliases?
Code quote:
int
dlck_obj_get_active(daos_handle_t coh, struct vos_iterator *iter, d_vector_t *dv)
{
assert_int_equal(coh.cookie, Coh.cookie);
assert_ptr_equal(iter, VOS_ITER_MOCK);
assert_ptr_equal(dv, DV_MOCK);
return mock_type(int);
}
int
dlck_irec_get_active(daos_handle_t coh, struct vos_iterator *iter, d_vector_t *dv)
{
assert_int_equal(coh.cookie, Coh.cookie);
assert_ptr_equal(iter, VOS_ITER_MOCK);
assert_ptr_equal(dv, DV_MOCK);
return mock_type(int);
}
int
dlck_sv_add_if_active(daos_handle_t coh, struct vos_iterator *iter, d_vector_t *dv)
{
assert_int_equal(coh.cookie, Coh.cookie);
assert_ptr_equal(iter, VOS_ITER_MOCK);
assert_ptr_equal(dv, DV_MOCK);
return mock_type(int);
}
int
dlck_ev_add_if_active(daos_handle_t coh, struct vos_iterator *iter, d_vector_t *dv)
{
assert_int_equal(coh.cookie, Coh.cookie);
assert_ptr_equal(iter, VOS_ITER_MOCK);
assert_ptr_equal(dv, DV_MOCK);
return mock_type(int);
}
janekmi
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @osalyk)
src/utils/dlck/tests/dlck_vos_cont_recs_get_active_ut.c line 88 at r1 (raw file):
Previously, osalyk (Oksana Sałyk) wrote…
Macros or maybe aliases?
- We can't have a helper function here for two reasons:
- having
assert_*()in a helper will also cause the error report to point a helper instead of the function the helper was called from. mock_type(int)has to be in a function the value is prepared for. So, providing values for a helper instead for the mocked functions directly will highly decrease the tests readability.
- We can't have a macro either:
- the error report will point a single line where the macro was used at best. Considering there are three assertions there it will be tricky to determine where the issue is.
Considering all of the above and that there are only 4 such functions I believe it would be best to keep them as they are.
osalyk
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @janekmi)
src/utils/dlck/tests/dlck_vos_cont_recs_get_active_ut.c line 88 at r1 (raw file):
Previously, janekmi (Jan Michalski) wrote…
- We can't have a helper function here for two reasons:
- having
assert_*()in a helper will also cause the error report to point a helper instead of the function the helper was called from.mock_type(int)has to be in a function the value is prepared for. So, providing values for a helper instead for the mocked functions directly will highly decrease the tests readability.
- We can't have a macro either:
- the error report will point a single line where the macro was used at best. Considering there are three assertions there it will be tricky to determine where the issue is.
Considering all of the above and that there are only 4 such functions I believe it would be best to keep them as they are.
pity, but I understand
ed51362 to
76d6f8d
Compare
Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
Signed-off-by: Jan Michalski <jan-marian.michalski@hpe.com>
09441c6
into
janekmi/DAOS-17569-DLCK-DAE-records-recover-main
This change is