Exemple #1
0
int main(int argc, char **argv)
{
    int idx;
    int num_compatible = sizeof(compatible_version) / sizeof(char *);
    int num_incompatible = sizeof(incompatible_version) / sizeof(char *);

    printf("NSPR release %s:\n", PR_VERSION);
    for (idx = 0; idx < num_compatible; idx++) {
        if (PR_VersionCheck(compatible_version[idx]) == PR_FALSE) {
            fprintf(stderr, "Should be compatible with version %s\n",
                    compatible_version[idx]);
            exit(1);
        }
        printf("Compatible with version %s\n", compatible_version[idx]);
    }

    for (idx = 0; idx < num_incompatible; idx++) {
        if (PR_VersionCheck(incompatible_version[idx]) == PR_TRUE) {
            fprintf(stderr, "Should be incompatible with version %s\n",
                    incompatible_version[idx]);
            exit(1);
        }
        printf("Incompatible with version %s\n", incompatible_version[idx]);
    }

    printf("PASS\n");
    return 0;
}
Exemple #2
0
int main(int argc, char **argv)
#endif
{
    int ret = 0;
    int idx;
    int num_compatible = sizeof(compatible_version) / sizeof(char *);
    int num_incompatible = sizeof(incompatible_version) / sizeof(char *);

    PR_fprintf(PR_STDOUT, "NSPR release %s:\n", PR_VERSION);
    for (idx = 0; idx < num_compatible; idx++) {
        if (PR_VersionCheck(compatible_version[idx]) == PR_FALSE) {
            PR_fprintf(PR_STDERR, "Should be compatible with version %s\n",
                    compatible_version[idx]);
            ret = 1;
            goto _errExit;
        }

        PR_fprintf(PR_STDOUT, "Compatible with version %s\n", compatible_version[idx]);
    }

    for (idx = 0; idx < num_incompatible; idx++) {
        if (PR_VersionCheck(incompatible_version[idx]) == PR_TRUE) {
            PR_fprintf(PR_STDERR, "Should be incompatible with version %s\n",
                    incompatible_version[idx]);
            ret = 1;
            goto _errExit;
        }
        PR_fprintf(PR_STDOUT, "Incompatible with version %s\n", incompatible_version[idx]);
    }

    PR_fprintf(PR_STDOUT, "PASS\n");

_errExit:
    return ret;
}