aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-07 14:35:57 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-07 14:35:57 -0400
commitcd852acd7e1feb5c35a37f9365e1e1b4658ca2f7 (patch)
tree5bdf36fa44d6efcb4abd51df27465260174c9ee7 /tests
parent3828e54c2c85fa377fb27f38ffd609940f5f19f8 (diff)
downloadstasis-cd852acd7e1feb5c35a37f9365e1e1b4658ca2f7.tar.gz
Add enum for wheel_package error handling
Diffstat (limited to 'tests')
-rw-r--r--tests/test_wheel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_wheel.c b/tests/test_wheel.c
index ee089c6..089bac1 100644
--- a/tests/test_wheel.c
+++ b/tests/test_wheel.c
@@ -14,7 +14,13 @@ static const char *testpkg_filename = "testpkg/dist/testpkg-1.0.0-py3-none-any.w
static void test_wheel_package() {
const char *filename = testpkg_filename;
struct Wheel *wheel = NULL;
- wheel_package(&wheel, filename);
+ int state = wheel_package(&wheel, filename);
+ STASIS_ASSERT(state != WHEEL_PACKAGE_E_ALLOC, "Cannot fail to allocate memory for package structure");
+ STASIS_ASSERT(state != WHEEL_PACKAGE_E_GET, "Cannot fail to parse wheel");
+ STASIS_ASSERT(state != WHEEL_PACKAGE_E_GET_METADATA, "Cannot fail to read wheel metadata");
+ STASIS_ASSERT(state != WHEEL_PACKAGE_E_GET_RECORDS, "Cannot fail reading wheel path records");
+ STASIS_ASSERT(state != WHEEL_PACKAGE_E_GET_ENTRY_POINT, "Cannot fail reading wheel entry points");
+ STASIS_ASSERT(state == WHEEL_PACKAGE_E_SUCCESS, "Wheel file should be usable");
STASIS_ASSERT(wheel != NULL, "wheel cannot be NULL");
STASIS_ASSERT(wheel != NULL, "wheel_package failed to initialize wheel struct");
STASIS_ASSERT(wheel->record != NULL, "Record cannot be NULL");