[PATCH v2 16/31] test: Expand implementation of ut_list_has_dm_tests()