refactor: Package archive parser now returns meaningful error enums in case of failure.
This commit is contained in:
parent
c7c4043108
commit
4c9b429eaa
3 changed files with 22 additions and 12 deletions
|
|
@ -39,8 +39,9 @@ void test_info_parse() {
|
|||
}
|
||||
|
||||
void test_pkg_read_archive_files() {
|
||||
vieter_package *pkg = vieter_package_read_archive("./test/package/xcursor-dmz-0.4.5-2-any.pkg.tar.zst");
|
||||
TEST_ASSERT_(pkg != NULL, "failure parsing pkg archive");
|
||||
vieter_package *pkg = vieter_package_init();
|
||||
vieter_package_error e = vieter_package_read_archive(pkg, "./test/package/xcursor-dmz-0.4.5-2-any.pkg.tar.zst");
|
||||
TEST_ASSERT_(e == vieter_package_ok, "failure parsing pkg archive");
|
||||
|
||||
FILE *f = fopen("./test/package/files", "r");
|
||||
TEST_ASSERT_(f != NULL, "could not find test files file in ./test/package");
|
||||
|
|
@ -58,12 +59,12 @@ void test_pkg_read_archive_files() {
|
|||
TEST_CHECK(pkg->compression = 14);
|
||||
|
||||
vieter_package_free(&pkg);
|
||||
|
||||
}
|
||||
|
||||
void test_pkg_read_archive_desc() {
|
||||
vieter_package *pkg = vieter_package_read_archive("./test/package/xcursor-dmz-0.4.5-2-any.pkg.tar.zst");
|
||||
TEST_ASSERT_(pkg != NULL, "failure parsing pkg archive");
|
||||
vieter_package *pkg = vieter_package_init();
|
||||
vieter_package_error e = vieter_package_read_archive(pkg, "./test/package/xcursor-dmz-0.4.5-2-any.pkg.tar.zst");
|
||||
TEST_ASSERT_(e == vieter_package_ok, "failure parsing pkg archive");
|
||||
|
||||
char *description = vieter_package_to_description(pkg);
|
||||
|
||||
|
|
|
|||
Reference in a new issue