tools-make/TestFramework/example5.m
Richard Frith-MacDonald 2d02dc0f97 furthr test framework improvements
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@32181 72102866-910b-0410-8b05-ffd578937521
2011-02-16 05:44:45 +00:00

34 lines
774 B
Objective-C

#import <Testing.h>
/* A fifth test ... hope.
*
* If you run the test with 'gnustep-tests example5.m' it should
* report one hope dashed and two test passes.
*/
int
main()
{
START_SET(YES)
/* 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;
}