-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TextureBrush tests and fix a compat bug (#80)
- Loading branch information
1 parent
59ad2ec
commit 17e3a55
Showing
5 changed files
with
828 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ testclip | |
testfont | ||
testgraphics | ||
testgdi | ||
testreversepath | ||
testpen | ||
testpng | ||
testreversepath | ||
testtexturebrush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <assert.h> | ||
#include <math.h> | ||
#include <float.h> | ||
|
||
static int floatsEqual(float v1, float v2) | ||
{ | ||
return fabs (v1 - v2) < 0.0001; | ||
} | ||
|
||
static void verifyMatrix (GpMatrix *matrix, REAL e1, REAL e2, REAL e3, REAL e4, REAL e5, REAL e6) | ||
{ | ||
float elements[6]; | ||
GdipGetMatrixElements (matrix, elements); | ||
|
||
printf ("Actual: %f, %f, %f, %f, %f, %f\n", e1, e2, e3, e4, e5, e6); | ||
printf ("Expected: %f, %f, %f, %f, %f, %f\n\n", elements[0], elements[1], elements[2], elements[3], elements[4], elements[5]); | ||
|
||
assert (floatsEqual(elements[0], e1)); | ||
assert (floatsEqual(elements[1], e2)); | ||
assert (floatsEqual(elements[2], e3)); | ||
assert (floatsEqual(elements[3], e4)); | ||
assert (floatsEqual(elements[4], e5)); | ||
assert (floatsEqual(elements[5], e6)); | ||
} |
Oops, something went wrong.