Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: an automated test to confirm that PhysFS links and works #54

Open
v1993 opened this issue Apr 11, 2023 · 0 comments
Open

Suggestion: an automated test to confirm that PhysFS links and works #54

v1993 opened this issue Apr 11, 2023 · 0 comments

Comments

@v1993
Copy link

v1993 commented Apr 11, 2023

SDL2_image has an amazing test suite that checks loaders. While it would be great to have that for PhysFS (i.e. have a set of archives with identical content that are compared against reference directory), something simple like

#include <stdio.h>
#include <stdlib.h>

#define PHYSFS_DEPRECATED
#include "physfs.h"

int main(int argc, char **argv) {
    if (!PHYSFS_init(argv[0])) {
        printf("PHYSFS_init() failed!\n  reason: %s.\n", PHYSFS_getLastError());
        return 1;
    }

    printf("PhysFS initialized\n");

    if (!PHYSFS_deinit()) {
        printf("PHYSFS_deinit() failed!\n  reason: %s.\n", PHYSFS_getLastError());
        return 1;
    }

    printf("PhysFS deinitialized\n");
    return 0;
}

would still be fine to confirm that program using PhysFS links and loads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant