From 709334eedec26e284f766072b630fa9171d27086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 1 Apr 2019 00:02:49 +0200 Subject: tests: add tests on function util_parse_delay with unit "ms" (milliseconds) --- tests/unit/core/test-core-util.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/unit/core/test-core-util.cpp') diff --git a/tests/unit/core/test-core-util.cpp b/tests/unit/core/test-core-util.cpp index 0d29a832d..eeaa61d2d 100644 --- a/tests/unit/core/test-core-util.cpp +++ b/tests/unit/core/test-core-util.cpp @@ -124,6 +124,7 @@ TEST(CoreUtil, ParseDelay) /* tests with delay == 0 */ LONGS_EQUAL(0, util_parse_delay ("0", 1)); + LONGS_EQUAL(0, util_parse_delay ("0ms", 1)); LONGS_EQUAL(0, util_parse_delay ("0s", 1)); LONGS_EQUAL(0, util_parse_delay ("0m", 1)); LONGS_EQUAL(0, util_parse_delay ("0h", 1)); @@ -131,12 +132,14 @@ TEST(CoreUtil, ParseDelay) /* tests with delay == 123, default_factor = 1 */ LONGS_EQUAL(123, util_parse_delay ("123", 1)); LONGS_EQUAL(123, util_parse_delay ("123", 1)); + LONGS_EQUAL(123, util_parse_delay ("123ms", 1)); LONGS_EQUAL(123 * 1000, util_parse_delay ("123s", 1)); LONGS_EQUAL(123 * 1000 * 60, util_parse_delay ("123m", 1)); LONGS_EQUAL(123 * 1000 * 60 * 60, util_parse_delay ("123h", 1)); /* tests with delay == 123, default_factor = 1000 */ LONGS_EQUAL(123 * 1000, util_parse_delay ("123", 1000)); + LONGS_EQUAL(123, util_parse_delay ("123ms", 1000)); LONGS_EQUAL(123 * 1000, util_parse_delay ("123s", 1000)); LONGS_EQUAL(123 * 1000 * 60, util_parse_delay ("123m", 1000)); LONGS_EQUAL(123 * 1000 * 60 * 60, util_parse_delay ("123h", 1000)); -- cgit v1.2.3