Modules determine their own compatibility with the library
A module is built against the system-installed libdpm-core.so and is responsible for being correct against it. Where it needs to act on the version it is running under, dpm_core_version() reports that and the module decides for itself. dpm_module_core_min() is removed. It was a declaration handed to the library to enforce on the module's behalf, and enforcement of that kind belongs nowhere in a library that routes and hosts. The contract is now three reserved symbols and load validation is two steps: the reserved symbols resolve, and the version and description probes return well-formed values. compare_versions had no remaining caller and is removed; parse_version stays for the well-formedness probe. The core_too_new fixture went with the handshake it existed to exercise.
This commit is contained in:
@@ -102,9 +102,6 @@ int main(void)
|
||||
CHECK(error_contains(ctx, "missing required contract symbols"));
|
||||
CHECK(error_contains(ctx, "dpm_module_execute"));
|
||||
|
||||
CHECK(dpm_require(ctx, "core_too_new") == nullptr);
|
||||
CHECK(error_contains(ctx, "update libdpm-core"));
|
||||
|
||||
CHECK(dpm_require(ctx, "bad_version") == nullptr);
|
||||
CHECK(error_contains(ctx, "malformed version"));
|
||||
|
||||
@@ -125,7 +122,6 @@ int main(void)
|
||||
CHECK(dpm_module_info_of(ctx, good, &seen) == 0);
|
||||
CHECK(std::strcmp(seen.name, "good") == 0);
|
||||
CHECK(std::strcmp(seen.version, "1.2.3") == 0);
|
||||
CHECK(std::strcmp(seen.core_min, "0.1.0") == 0);
|
||||
CHECK(seen.description != nullptr && *seen.description);
|
||||
|
||||
CHECK(dpm_module_info_of(ctx, nullptr, &seen) != 0);
|
||||
@@ -150,7 +146,6 @@ int main(void)
|
||||
count++;
|
||||
CHECK(std::strcmp(info.name, "good") == 0);
|
||||
CHECK(std::strcmp(info.version, "1.2.3") == 0);
|
||||
CHECK(std::strcmp(info.core_min, "0.1.0") == 0);
|
||||
CHECK(info.description != nullptr && *info.description);
|
||||
}
|
||||
CHECK(count == 1);
|
||||
|
||||
Reference in New Issue
Block a user