return EXIT_FAILURE;
}
+static int test_fail(const struct test* t) {
+ struct pakfire* pakfire = NULL;
+
+ // Init without anything
+ ASSERT(pakfire_create(&pakfire, t->ctx, NULL, NULL, NULL, 0) == -EINVAL);
+
+ // Invalid architecture
+ ASSERT(pakfire_create(&pakfire, t->ctx, NULL, "arch", NULL, 0) == -ENOTSUP);
+
+ // Invalid path (must be absolute)
+ ASSERT(pakfire_create(&pakfire, t->ctx, "path", NULL, NULL, 0) == -EINVAL);
+
+ // Cannot use snapshots with a path
+ ASSERT(pakfire_create(&pakfire, t->ctx, PAKFIRE_TMP_DIR "/test",
+ NULL, NULL, PAKFIRE_USE_SNAPSHOT) == -EINVAL);
+
+ return EXIT_SUCCESS;
+
+FAIL:
+ return EXIT_FAILURE;
+}
+
int main(int argc, const char* argv[]) {
testsuite_add_test(test_init, TEST_WANTS_PAKFIRE);
+ testsuite_add_test(test_fail, 0);
return testsuite_run(argc, argv);
}