mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-25 23:21:05 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@32181 72102866-910b-0410-8b05-ffd578937521
39 lines
1 KiB
Objective-C
39 lines
1 KiB
Objective-C
#import <Testing.h>
|
|
|
|
/* A sixth test ... need.
|
|
*
|
|
* If you run the test with 'gnustep-tests example6.m' it should
|
|
* report one hope dashed, one test pass, and one set failed.
|
|
*/
|
|
int
|
|
main()
|
|
{
|
|
START_SET(YES)
|
|
|
|
/* First set a flag to say that we are not expecting tests to
|
|
* actually pass.
|
|
*/
|
|
testHopeful = YES;
|
|
|
|
/* Here we demonstrate the NEED macro. This says that a need must be met
|
|
* in order to continue with the set ... if the test does not pass
|
|
* we can't complete the set and we skip to the end.
|
|
*/
|
|
NEED(PASS(1 == 0, "silly test which we don't expect to pass"))
|
|
|
|
/* This test should never be reached because the previous test needs to
|
|
* pass, but will not do so.
|
|
*/
|
|
PASS(1 == 1, "integer equality works")
|
|
|
|
/* The set should be unresolved, because the earlier need was not met.
|
|
*/
|
|
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;
|
|
}
|