aboutsummaryrefslogtreecommitdiff
path: root/test/core.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-02-02 19:38:00 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-02-02 19:38:00 +0100
commit4b2478e4a7aba04d0c730a602df0ba28a53e46b0 (patch)
tree75adedc6198306ee18960effc7a44fbf0747877e /test/core.c
parent4185cee4d45c650447799604efd91bef866c6b82 (diff)
downloadd2tk-4b2478e4a7aba04d0c730a602df0ba28a53e46b0.tar.xz
core/test: make valgrind-clean.
Diffstat (limited to 'test/core.c')
-rw-r--r--test/core.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/core.c b/test/core.c
index df59874..6b9f68c 100644
--- a/test/core.c
+++ b/test/core.c
@@ -135,13 +135,15 @@ _d2tk_mock_process_triple(void *data, d2tk_core_t *core, const d2tk_com_t *com,
uintptr_t *sprite = d2tk_core_get_sprite(core, body->hash, 1);
assert(sprite);
- //assert(*sprite == 0);
- uint32_t *dummy = calloc(1, sizeof(uint32_t));
- assert(dummy);
- *dummy = 1234;
+ if(*sprite == 0)
+ {
+ uint32_t *dummy = calloc(1, sizeof(uint32_t));
+ assert(dummy);
+ *dummy = 1234;
- *sprite = (uintptr_t)dummy;
+ *sprite = (uintptr_t)dummy;
+ }
assert(sprite == d2tk_core_get_sprite(core, body->hash, 1));
assert(sprite != d2tk_core_get_sprite(core, body->hash, 0));