[sheepdog] [PATCH] tests/unit: use strnumber instead of size_to_str
MORITA Kazutaka
morita.kazutaka at gmail.com
Mon Aug 26 14:54:57 CEST 2013
From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
tests/unit/dog/test_common.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/tests/unit/dog/test_common.c b/tests/unit/dog/test_common.c
index 6fec940..f31ab0e 100644
--- a/tests/unit/dog/test_common.c
+++ b/tests/unit/dog/test_common.c
@@ -18,17 +18,15 @@
/* test */
START_TEST(test_common)
{
- char str[100];
-
raw_output = true;
- ck_assert_str_eq(size_to_str(10, str, 100), "10");
- ck_assert_str_eq(size_to_str(10000, str, 100), "10000");
- ck_assert_str_eq(size_to_str(100000000, str, 100), "100000000");
+ ck_assert_str_eq(strnumber(10), "10");
+ ck_assert_str_eq(strnumber(10000), "10000");
+ ck_assert_str_eq(strnumber(100000000), "100000000");
raw_output = false;
- ck_assert_str_eq(size_to_str(10, str, 100), "0.0 MB");
- ck_assert_str_eq(size_to_str(10000, str, 100), "0.0 MB");
- ck_assert_str_eq(size_to_str(100000000, str, 100), "95 MB");
+ ck_assert_str_eq(strnumber(10), "0.0 MB");
+ ck_assert_str_eq(strnumber(10000), "0.0 MB");
+ ck_assert_str_eq(strnumber(100000000), "95 MB");
}
END_TEST
--
1.7.9.5
More information about the sheepdog
mailing list