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
33 lines
901 B
Objective-C
33 lines
901 B
Objective-C
#import <Testing.h>
|
|
#import <NSFoundation/NSGeometry.h>
|
|
|
|
/* An eighth test ... complex code fragments
|
|
*
|
|
* If you run the test with 'gnustep-tests example8.m' it should
|
|
* report one test pass.
|
|
*/
|
|
int
|
|
main()
|
|
{
|
|
/* Start a set.
|
|
*/
|
|
START_SET(YES)
|
|
|
|
/* Here we demonstrate that the 'expression' evaluated by the PASS
|
|
* macro can actually be an arbitrarily complex piece of code as
|
|
* long as the last statement returns an integral value which can
|
|
* be used to represent a pass (non zero) or fail (if zero).
|
|
* Where such a code fragment contains commas, it must be written
|
|
* inside brackets to let the macro preprocessor know that the whole
|
|
* code fragement is the first parameter to the macro.
|
|
*/
|
|
PASS(({
|
|
NSRange r = NSMakeRange(1, 10);
|
|
|
|
NSEqualRanges(r, NSMakeRange(1, 10));
|
|
}), "a long code-fragment/expression works")
|
|
|
|
END_SET("test set")
|
|
|
|
return 0;
|
|
}
|