diff --git a/tests/test-obj.h b/tests/test-obj.h index 5615a6d0..8c19762d 100644 --- a/tests/test-obj.h +++ b/tests/test-obj.h @@ -44,8 +44,10 @@ static void testobj_init_set(testobj_t d, const testobj_t s) static void testobj_set(testobj_t d, const testobj_t s) { - testobj_clear(d); - testobj_init_set(d, s); + if (d != s) { + testobj_clear(d); + testobj_init_set(d, s); + } } static void testobj_set_ui(testobj_t d, unsigned int v)