/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* * File: vercheck.c * * Description: * This test tests the PR_VersionCheck() function. The * compatible_version and incompatible_version arrays * need to be updated for each patch or release. * * Tested areas: library version compatibility check.
*/
/* * This release is not backward compatible with the old * NSPR 2.1 and 3.x releases. * * Any release is incompatible with future releases and * patches.
*/ staticchar* incompatible_version[] = { "2.1 19980529", "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", "4.36.1", "4.37", "4.37.1", "10.0", "11.1", "12.14.20"};
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;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.