void test(void). A test can also be declared
with arguments as shown in sample202.1below
void test_deg2rad(double degrees, double radians, double *error) {
double result = deg2rad(degrees);
*error = result-radians;
VALIDATE_FP(result , radians);
}
void testmain(void) {
double rounding_error;
EXECUTE(test_deg2rad, 360, 2*PI, &rounding_error);
COMMENT("Rounding error is %f\n", rounding_error );
}
If the test are executed repeatedly, e.g. they have been setup with a PARAMETER macro, each call
will use the same function arguments. By passing PARAMETER_VALUE as a one of these, this argument
can be made to vary with each test run, e.g. in sample212.1
void test_deg2rad(double degrees, double radians) {
double result = deg2rad(degrees);
VALIDATE_FP(result , radians);
}
void testmain(void) {
PARAMETER_RANGE_FP(2*PI, 10*PI, 2*PI);
EXECUTE(test_deg2rad, 360, PARAMETER_VALUE_FP);
}
TestApe will pass commandline arguments after the --args tag to testmain, so
if the test executable are invoked like this
./sample22 --args 4
argc will be 1 and argv[0] will be "4" in the testmain function declared in sample222.1below
void test_deg2rad(double degrees, double radians) {
double result = deg2rad(degrees);
*error = result-radians;
VALIDATE_FP(result , radians);
}
int testmain(int argc, char *argv[]) {
double rounding_error;
int number = atoi(argv[0]);
EXECUTE(test_deg2rad, 360, number*PI, &rounding_error);
COMMENT("Rounding error for number equals %d is %f\n", number, rounding_error);
}
New is this release are support for floating point validations and function mocking. Also, MinGW has been added to the list of supported platforms.
moreTestApe forum is now hosted on Proboards. Support questions can be posted here or send directly on email. Due to ...
moreTestApe can now be used with MinGW GCC on windows. Also supported in this beta are floating point types in validations or when mocking functions
moreA small fix for webtty scripts, to allow the usage from Apple IPads. Tab on textarea to bring up IPad keyboard - you may have to scroll webpage beneath keyboard, in order to actually see what you're typing.
This release contains a new flexible mocking system with default mocks automatically generated for unresolved functions. Installation packages are available for GCC/Linux, GCC/CygWin as well Visual Studio 2009/Windows XP or Vista.
moreNew beta version is now available for download. This is the last beta before official release. The release supports an extensive mocking system.
moreThere is a change for the forum hosted on this site. The previous phpBB forum is closed for now. All forum threads will be migrated to a new simple blog. ...
more