Refactors mr_ref_tests.hpp and the .cpp files that include it to use a hierarchy of factory classes in which the base class contains a resource_ref and the derived classes are templated on the actual resource type and own the MR under test to maintain its lifetime. This way the tests can still be value parameterized (by name) and the test machinery can be type erased. In the future, if CCCL adds an any_resource type-erased owning resource container, we can use that to simplify this machinery.
Note that until #1598 merges, this PR necessarily disables (comments out) tests of set_current_device_resource(). This is because the test only has a resource_ref, so it can't set_current_device_resource(ref). #1598 adds set_current_device_resource_ref() which reenables this testing.
Description
Fixes #1444
Refactors mr_ref_tests.hpp and the .cpp files that include it to use a hierarchy of factory classes in which the base class contains a
resource_ref
and the derived classes are templated on the actual resource type and own the MR under test to maintain its lifetime. This way the tests can still be value parameterized (by name) and the test machinery can be type erased. In the future, if CCCL adds anany_resource
type-erased owning resource container, we can use that to simplify this machinery.Note that until #1598 merges, this PR necessarily disables (comments out) tests of
set_current_device_resource()
. This is because the test only has a resource_ref, so it can'tset_current_device_resource(ref).
#1598 addsset_current_device_resource_ref()
which reenables this testing.Checklist