2011-02-22 14:53:39 +00:00
|
|
|
#import "Testing.h"
|
2011-02-07 20:41:58 +00:00
|
|
|
|
|
|
|
/* A fifth test ... hope.
|
|
|
|
*
|
|
|
|
* If you run the test with 'gnustep-tests example5.m' it should
|
2011-02-16 05:44:45 +00:00
|
|
|
* report one hope dashed and two test passes.
|
2011-02-07 20:41:58 +00:00
|
|
|
*/
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
2011-02-24 16:26:01 +00:00
|
|
|
START_SET("example set")
|
2011-02-07 20:41:58 +00:00
|
|
|
|
|
|
|
/* First set a flag to say that we are not expecting tests to
|
|
|
|
* actually pass.
|
|
|
|
*/
|
|
|
|
testHopeful = YES;
|
|
|
|
|
|
|
|
/* Here the test should result in a dashed hope rather than a fail.
|
|
|
|
*/
|
|
|
|
PASS(1 == 0, "silly test which we don't expect to pass")
|
|
|
|
|
|
|
|
/* This test should simply pass of course.
|
|
|
|
*/
|
|
|
|
PASS(1 == 1, "integer equality works")
|
|
|
|
|
|
|
|
END_SET("example set")
|
|
|
|
|
|
|
|
/* And here we demonstrate that on exit from the set, the global
|
|
|
|
* variable is restored to its state on entry.
|
|
|
|
*/
|
|
|
|
pass(NO == testHopeful, "the flag state is restored outside the set");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|