From: Bartosz Golaszewski Date: Thu, 8 Jun 2017 13:26:24 +0000 (+0200) Subject: tests: improve the version string test X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=190555c3bc86989e785fce6c21af6f3f6b2fa572;p=qemu-gpiodev%2Flibgpiod.git tests: improve the version string test Use the recently introduced regex matching function to verify that the version string has a correct format. Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/tests-misc.c b/tests/tests-misc.c index 20679b9..178c277 100644 --- a/tests/tests-misc.c +++ b/tests/tests-misc.c @@ -17,6 +17,8 @@ static void version_string(void) /* Check that gpiod_version_string() returns an actual string. */ TEST_ASSERT_NOT_NULL(gpiod_version_string()); TEST_ASSERT(strlen(gpiod_version_string()) > 0); + TEST_ASSERT_REGEX_MATCH(gpiod_version_string(), + "^[0-9]+\\.[0-9]+[0-9a-zA-Z\\.]*$"); } TEST_DEFINE(version_string, "gpiod_version_string()",