Differences From Artifact [9a374ca140]:
- File
tests/OFMatrix4x4Tests.m
— part of check-in
[44eb35b212]
at
2023-02-12 22:20:39
on branch trunk
— Add OFMatrix4x4 and OFVector3D
These will be useful for 3D graphics. (user: js, size: 2378) [annotate] [blame] [check-ins using] [more...]
To Artifact [9aa8c2d363]:
- File tests/OFMatrix4x4Tests.m — part of check-in [1e550fabe3] at 2023-02-15 21:54:40 on branch trunk — OFMatrix4x4: Add -[transformedVector3D:] (user: js, size: 2556) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
static OFString *const module = @"OFMatrix4x4Tests";
@implementation TestsAppDelegate (OFMatrix4x4Tests)
- (void)matrix4x4Tests
{
void *pool = objc_autoreleasePoolPush();
OFMatrix4x4 *matrix, *matrix2;
TEST(@"+[identityMatrix]",
memcmp([[OFMatrix4x4 identityMatrix] values], (float [16]){
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
| > | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
static OFString *const module = @"OFMatrix4x4Tests";
@implementation TestsAppDelegate (OFMatrix4x4Tests)
- (void)matrix4x4Tests
{
void *pool = objc_autoreleasePoolPush();
OFMatrix4x4 *matrix, *matrix2;
OFVector3D vec3;
TEST(@"+[identityMatrix]",
memcmp([[OFMatrix4x4 identityMatrix] values], (float [16]){
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
|
| ︙ | ︙ | |||
82 83 84 85 86 87 88 89 90 91 |
[matrix2 isEqual: [OFMatrix4x4 matrixWithValues: (float [16]){
9000, 20200, 31400, 42600,
10000, 22800, 35600, 48400,
11000, 25400, 39800, 54200,
12000, 28000, 44000, 60000
}]])
objc_autoreleasePoolPop(pool);
}
@end
| > > > > | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
[matrix2 isEqual: [OFMatrix4x4 matrixWithValues: (float [16]){
9000, 20200, 31400, 42600,
10000, 22800, 35600, 48400,
11000, 25400, 39800, 54200,
12000, 28000, 44000, 60000
}]])
TEST(@"-[transformedVector3D:]",
R((vec3 = [matrix transformedVector3D: OFMakeVector3D(1, 2, 3)])) &&
vec3.x == 14 && vec3.y == 38 && vec3.z == 62)
objc_autoreleasePoolPop(pool);
}
@end
|