test: fix race in test_cache
test: fix race in test_cache

Test cache is very fragile because it manipulates cachelines and then
inspect them. Any non-cached memory access between manipulation and
inspection can affect the cachelines being tested, making the test
fail. It looks like that, depending on the phase of the moon, the
ASSERT_EQUAL_MEM function can taint the test by its usage of the stack.

Fix it by doing the actual memory comparison in test_cache.

DragonMinded/libdragon,DragonMinded/libdragon,sp1187/libdragon,DragonMinded/libdragon,sp1187/libdragon,sp1187/libdragon