test_driver.h

来自「mini database hpfile implement」· C头文件 代码 · 共 51 行

H
51
字号
// -*- C++ -*-
/* This file declares TestDriver, a base class for various test driver
   objects. */
#ifndef _TEST_DRIVER_H_
#define _TEST_DRIVER_H_

#include "minirel.h"
//extern "C" int unlink( const char* );

class TestDriver
{
public:
      // This runs a series of tests.  If it returns OK, then everything worked
      // as advertised.  Otherwise, there were errors reported.
    virtual Status runTests();


protected:
      // This constructs the tester.  You supply a name like "dbtest" as the
      // root of the database and log file names.
    TestDriver( const char* nameRoot );
    virtual ~TestDriver();

    char* dbpath;
    char* logpath;

      // Subclasses override these tests.
    virtual int test1();
    virtual int test2();
    virtual int test3();
    virtual int test4();
    virtual int test5();
    virtual int test6();

      // ...and this method, which is printed as the kind of test being done,
      // for example "Disk Space Management".
    virtual const char* testName();

    void testFailure( Status& status, Status expectedStatus,
                      const char* activity, int postedErrExpected = TRUE );

    typedef int (TestDriver::*testFunction)();
    virtual void runTest( Status& status, testFunction test );

    virtual Status runAllTests();
};



#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?