From: Michael Tremer Date: Mon, 8 Aug 2022 15:45:59 +0000 (+0000) Subject: tests: build: Try to create with invalid IDs X-Git-Tag: 0.9.28~575 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=915cd63a4db14455f83acc04c4b419c72706fa7c;p=pakfire.git tests: build: Try to create with invalid IDs Signed-off-by: Michael Tremer --- diff --git a/tests/libpakfire/build.c b/tests/libpakfire/build.c index a1a445005..94a4b1e3e 100644 --- a/tests/libpakfire/build.c +++ b/tests/libpakfire/build.c @@ -42,8 +42,24 @@ FAIL: return EXIT_FAILURE; } +static int test_create_with_invalid_ids(const struct test* t) { + struct pakfire_build* build = NULL; + + // Try to create a build with an invalid UUID + ASSERT_ERRNO(pakfire_build_create(&build, t->pakfire, "ABC", 0), EINVAL); + + // Try to create a build with an empty UUID + ASSERT_ERRNO(pakfire_build_create(&build, t->pakfire, "", 0), EINVAL); + + return EXIT_SUCCESS; + +FAIL: + return EXIT_FAILURE; +} + int main(int argc, char** argv) { testsuite_add_test(test_create_and_free); + testsuite_add_test(test_create_with_invalid_ids); return testsuite_run(); }