aboutsummaryrefslogtreecommitdiff
path: root/mapper.lv2/test
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-17 08:02:25 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-17 08:02:25 +0100
commit307b2d00eb002efc08a6315a1a67b722a39c1206 (patch)
tree64948e3d649acde2a2891909f269275678c15e17 /mapper.lv2/test
parent67dcd89870c9c95611b6787caa08131fb85be7e5 (diff)
parentfb02e52e0f6d0ac2746aac966847e1a4d39f821c (diff)
downloadsynthpod-307b2d00eb002efc08a6315a1a67b722a39c1206.tar.xz
Merge commit 'fb02e52e0f6d0ac2746aac966847e1a4d39f821c' into nk
Diffstat (limited to 'mapper.lv2/test')
-rw-r--r--mapper.lv2/test/mapper_test.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mapper.lv2/test/mapper_test.c b/mapper.lv2/test/mapper_test.c
index 19210f46..7b649b14 100644
--- a/mapper.lv2/test/mapper_test.c
+++ b/mapper.lv2/test/mapper_test.c
@@ -170,6 +170,10 @@ main(int argc, char **argv)
pthread_join(pool->thread, NULL);
}
+ // query usage
+ const uint32_t usage = mapper_get_usage(mapper);
+ assert(usage == MAX_ITEMS/2);
+
// query rt memory allocations and frees
const uint32_t nalloc = atomic_load_explicit(&rtmem->nalloc, memory_order_relaxed);
const uint32_t nfree = atomic_load_explicit(&rtmem->nfree, memory_order_relaxed);
@@ -183,6 +187,9 @@ main(int argc, char **argv)
mapper_pool_deinit(mapper_pool);
}
+ // query usage after freeing elements
+ assert(mapper_get_usage(mapper) == 0);
+
// free threads
free(pools);
@@ -202,8 +209,8 @@ main(int argc, char **argv)
// report rt memory allocations and collisions
printf("\trt-allocs: %.1f%%, rt-collisions: %.1f%%\n",
- 200.f * (nalloc - nfree) / MAX_ITEMS,
- 200.f * nfree / MAX_ITEMS);
+ 100.f * (nalloc - nfree) / usage,
+ 100.f * nfree / usage);
return 0;
}