case LOG_INFO:
// Filter out any dependencies that are provided by this package
if (ctx->dep == PAKFIRE_PKG_REQUIRES) {
- r = pakfire_package_matches_dep(ctx->pkg, PAKFIRE_PKG_PROVIDES, buffer);
- if (r > 0) {
+ if (pakfire_package_matches_dep(ctx->pkg, PAKFIRE_PKG_PROVIDES, buffer)) {
ERROR(pakfire,
- "Skipping dependency that is provided by the package itself: %s\n",
- buffer);
+ "Skipping dependency that is provided by the package itself: %s\n", buffer);
return 0;
}
}
"test", "1.0-1", "x86_64"));
// Check if the package matches itself
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "test") == 1);
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "test = 1.0-1") == 1);
+ ASSERT_TRUE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "test"));
+ ASSERT_TRUE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "test = 1.0-1"));
// Add a couple of things this package provides
ASSERT_SUCCESS(pakfire_package_add_dep(pkg, PAKFIRE_PKG_PROVIDES, "a = 1"));
ASSERT_SUCCESS(pakfire_package_add_dep(pkg, PAKFIRE_PKG_PROVIDES, "b"));
// Check if the package matches those dependencies
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "a") == 1);
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "a = 1") == 1);
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "a >= 1") == 1);
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "a <= 1") == 1);
+ ASSERT_TRUE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "a"));
+ ASSERT_TRUE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "a = 1"));
+ ASSERT_TRUE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "a >= 1"));
+ ASSERT_TRUE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "a <= 1"));
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "b") == 1);
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "b = 1") == 1);
+ ASSERT_TRUE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "b"));
+ ASSERT_TRUE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "b = 1"));
// Check for something that doesn't exist
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "c") == 0);
- ASSERT_SUCCESS(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "c = 2") == 0);
+ ASSERT_FALSE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "c"));
+ ASSERT_FALSE(pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, "c = 2"));
// Everything passed
r = EXIT_SUCCESS;