odyssey: fix machinarium stat tests

This commit is contained in:
Dmitry Simonenko 2018-09-05 16:08:29 +03:00
parent de824a3373
commit 366f9b5312
2 changed files with 18 additions and 12 deletions

View File

@ -8,16 +8,18 @@ machinarium_test_config(void)
{
machinarium_set_pool_size(1);
machinarium_init();
int count_machine = 0;
int count_coroutine = 0;
int count_coroutine_cache = 0;
int msg_allocated = 0;
int msg_cache_count = 0;
int msg_cache_size = 0;
uint64_t count_machine = 0;
uint64_t count_coroutine = 0;
uint64_t count_coroutine_cache = 0;
uint64_t msg_allocated = 0;
uint64_t msg_cache_count = 0;
uint64_t msg_cache_gc_count = 0;
uint64_t msg_cache_size = 0;
machinarium_stat(&count_machine, &count_coroutine,
&count_coroutine_cache,
&msg_allocated,
&msg_cache_count,
&msg_cache_gc_count,
&msg_cache_size);
test(count_machine == 1);
machinarium_free();

View File

@ -15,12 +15,13 @@ machinarium_test_stat(void)
{
machinarium_init();
int count_machine = 0;
int count_coroutine = 0;
int count_coroutine_cache = 0;
int msg_allocated = 0;
int msg_cache_count = 0;
int msg_cache_size = 0;
uint64_t count_machine = 0;
uint64_t count_coroutine = 0;
uint64_t count_coroutine_cache = 0;
uint64_t msg_allocated = 0;
uint64_t msg_cache_count = 0;
uint64_t msg_cache_gc_count = 0;
uint64_t msg_cache_size = 0;
for (;;) {
@ -28,6 +29,7 @@ machinarium_test_stat(void)
&count_coroutine_cache,
&msg_allocated,
&msg_cache_count,
&msg_cache_gc_count,
&msg_cache_size);
test(count_machine == 3); /* thread pool */
test(count_coroutine_cache == 0);
@ -47,6 +49,7 @@ machinarium_test_stat(void)
&count_coroutine_cache,
&msg_allocated,
&msg_cache_count,
&msg_cache_gc_count,
&msg_cache_size);
test(count_machine == 3 + 1);
test(count_coroutine_cache == 0);
@ -66,6 +69,7 @@ machinarium_test_stat(void)
&count_coroutine_cache,
&msg_allocated,
&msg_cache_count,
&msg_cache_gc_count,
&msg_cache_size);
test(count_machine == 3)
if (count_coroutine != 3) {