|
#ifndef _TESTCASES_INCLUDED
#define _TESTCASES_INCLUDED
#include "MTParser.h"
// A set of test expressions to do
// regression testing when modifying the code
class MTTestCases
{
public:
// launch the test
// return true if all tests passed
bool test();
private:
struct TESTCASE
{
MTSTRING expr;
MTDOUBLE expectedResult;
bool valid;
};
std::vector<TESTCASE> m_testCases;
// add a test case to the test suite
void addTest(MTSTRING expr, MTDOUBLE result, bool valid);
// run all registered tests
bool runTest();
// helper function: convert a long value to a string value
MTSTRING longToS(long val);
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.