Ejemplo n.º 1
0
void
TestPath::removeTests()
{
  while ( isValid() )
    removeTest( 0 );
}
Ejemplo n.º 2
0
void
TestPath::up()
{
  checkIndexValid( 0 );
  removeTest( getTestCount() -1 );
}
Ejemplo n.º 3
0
/**
 * Runs the test suite.
 */
int runTests() {
    int hr = SUCCESS;

#ifndef EXTRA_CREDIT
#ifndef COMPETITION_TEST
    FILE *f_ls_base;
#else
    FILE *f_ls_compTest;
#endif
#endif

#ifdef EXTRA_CREDIT
    FILE *f_ls_extra_credit;
#endif

#if COMPETITION
    FILE *f_ls_competition;
    f_ls_competition = fopen("competition.ls", "w");
#endif

    RUN_TEST(initDiskTest());

#ifndef EXTRA_CREDIT
#ifndef COMPETITION_TEST
    f_ls_base = fopen("base.ls", "w");
    f_ls = f_ls_base;
    RUN_TEST(initFSTest());
    RUN_TEST(createSimpleFileTest());
    RUN_TEST(createSimpleFileTest());
    RUN_TEST(createSimpleFileWriteReadTest());
    RUN_TEST(singleBigFileTest());
    RUN_TEST(multipleFilesTest());
    RUN_TEST(createFolderTest());
    RUN_TEST(multipleFoldersTest());
    RUN_TEST(appendFileTest());
    RUN_TEST(multipleOpenFilesTest());
    RUN_TEST(nestedFoldersTest());
    RUN_TEST(errorTest());
#else
    f_ls_compTest = fopen("compTest.ls", "w");
    f_ls = f_ls_compTest;
    RUN_TEST(customTest());
#endif
#endif

#ifdef EXTRA_CREDIT
    f_ls_extra_credit = fopen("extra_credit.ls", "w");
    f_ls = f_ls_extra_credit;
    RUN_TEST(removeTest());
#endif

    // NOTE: We're not using this competition code this year.
#if COMPETITION
    f_ls = f_ls_competition;
    RUN_TEST(perfTest());
#endif


    Fail:

#ifndef EXTRA_CREDIT
#ifndef COMPETITION_TEST
    fclose(f_ls_base);
#else
    fclose(f_ls_compTest);
#endif
#endif

#ifdef EXTRA_CREDIT
    fclose(f_ls_extra_credit);
#endif

#if COMPETITION
    fclose(f_ls_competition);
#endif

    return hr;
}