nserver

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 10cc7513914fddbf654e27c795c775a939bc636a
parent 20cac9c3c438aac49d1dcd87fec24c17bdcbfa8c
Author: rsiddharth <s@ricketyspace.net>
Date:   Sat, 11 Apr 2020 01:20:19 -0400

nserver: Update Stats_stringify.

* nserver/src/stats.c (Stats_stringify): Change format of stringified Stats.
* nserver/tests/stats_tests.c (test_stats_stringify): Update test.

Diffstat:
nserver/src/stats.c | 2+-
nserver/tests/stats_tests.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/nserver/src/stats.c b/nserver/src/stats.c @@ -76,7 +76,7 @@ char *Stats_stringify(Stats *st) // stringify the stats int rc = snprintf(stats_str, stats_str_len, - "%.2f::%.2f::%ld::%.2f::%.2f", + "%.2f:%.2f:%ld:%.2f:%.2f", st->sum, st->sumsq, st->n, st->min, st->max); check(rc > 0, "stringify stats failed"); diff --git a/nserver/tests/stats_tests.c b/nserver/tests/stats_tests.c @@ -22,7 +22,7 @@ char *test_stats_stringify() char *st_str = Stats_stringify(st); mu_assert(st_str != NULL, "stats stringify failed"); - char *expected_st_str = "8238.34::4260238.83::28::28.39::238.27"; + char *expected_st_str = "8238.34:4260238.83:28:28.39:238.27"; mu_assert(strncmp(st_str, expected_st_str, strlen(expected_st_str)) == 0, "stringified str invalid");