int main(int argc, char** argv) {
    char *fileName;
    fileName = (char*) malloc(60 * sizeof(char));
    if(argc != 2) {
        printf("Please enter base file name: ");
        scanf("%s", fileName);
    }
    else {
        fileName = argv[1];
    }
    createTestSummary(fileName);

    return 0;
}
Beispiel #2
0
void tests() {
    int testsCount = 28;
    TestResult* (*tests[28])() = {
        allocateNewStringTestEmpty,
        allocateNewStringTestNonEmpty,
        stringLengthTestEmptyString,
        stringLengthTestNonEmptyString,
        concatTestEmptyString,
        concatTestNonEmptyString,
        stringConcat3TestEmptyString,
        stringConcat3TestNonEmptyString,
        powerTestZeroPower,
        powerTestPositivePower,
        powerTestNegativeBase,
        digitsCountTestNegativeNumber,
        truncateTest,
        fractionalPartTestPositiveNumber,
        fractionalPartTestNegativeNumber,
        convertStringToJsonFieldNameTest,
        convertStringToJsonStringTestEmptyString,
        convertStringToJsonStringTestNonEmptyString,
        convertIntToJsonBoolTestFalse,
        convertIntToJsonBoolTestTrue,
        convertIntToStringTest,
        convertDoubleToStringTest,
        convertIntToJsonFieldTest,
        convertStringToJsonFieldTest,
        convertIntToJsonFieldBoolTestTrue,
        convertIntToJsonFieldBoolTestFalse,
        convertDoubleToJsonFieldTest,
        createNullJsonFieldTest
    };
    int i;
    TestResult* result;
    char* summary;
    for (i = 0; i < testsCount; i++) {
        result = tests[i]();
        summary = createTestSummary(result -> testName, result -> passed);
        printf("%s\n", summary);
        free(result);
        free(summary);
    }
}