]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
parse_lastdigest: add a real test about what is expected
authorBaptiste Daroussin <bapt@FreeBSD.org>
Mon, 18 Dec 2023 08:17:39 +0000 (09:17 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Mon, 18 Dec 2023 08:17:39 +0000 (09:17 +0100)
tests/mlmmj.c

index 27b188be1f61cb70d1a0995f6926d0ee53fe65d0..e68f76434458925f463a6b44d4e5a356ad441841 100644 (file)
@@ -763,6 +763,14 @@ ATF_TC_BODY(parse_lastdigest, tc)
            &errstr));
        ATF_REQUIRE_STREQ(errstr, "Invalid value for lastissue");
        free(line);
+
+       line = xstrdup("3774:1702743593:141");
+       ATF_REQUIRE(parse_lastdigest(line, &lastindex, &lasttime, &lastissue,
+           &errstr));
+       ATF_REQUIRE_EQ(lastindex, 3774);
+       ATF_REQUIRE_EQ(lasttime, 1702743593);
+       ATF_REQUIRE_EQ(lastissue, 141);
+       free(line);
 }
 
 ATF_TC_BODY(extract_bouncetime, tc)