]> git.ipfire.org Git - pakfire.git/commitdiff
dependencies: Check parsing invalid inputs
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 5 Oct 2021 15:41:44 +0000 (15:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 5 Oct 2021 15:41:44 +0000 (15:41 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/libpakfire/dependencies.c

index 673ff71a659d7b984830c74f901bd2bb7ab942ab..dd0094bcf51ce21943d41f0da1e27828d4178894 100644 (file)
@@ -72,6 +72,11 @@ static int test_dependencies(const struct test* t) {
        Id dep = 0;
        const char* result = NULL;
 
+       // Check some invalid inputs
+       ASSERT_ERRNO(pakfire_str2dep(t->pakfire, NULL) == 0, EINVAL);
+       ASSERT_ERRNO(pakfire_str2dep(t->pakfire, "") == 0, EINVAL);
+
+       // Check some valid inputs
        for (const char** relation = relations; *relation; relation++) {
                printf("Parsing '%s'...\n", *relation);