Created
February 21, 2013 23:29
-
-
Save muep/5009424 to your computer and use it in GitHub Desktop.
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
int test_higher() | |
{ | |
static const struct { | |
int src; | |
int mul; | |
int higher; | |
} expected[] = { | |
{ -5, 4, -4 }, | |
{ -4, 4, -4 }, | |
{ -3, 4, -4 }, | |
{ -2, 4, -4 }, | |
{ -1, 4, -4 }, | |
{ 0, 4, 0 }, | |
{ 4, 4, 4 }, | |
{ 5, 4, 8 }, | |
{ 6, 4, 8 }, | |
{ 7, 4, 8 }, | |
{ 8, 4, 8 }, | |
{ 8, 4, 12 } | |
}; | |
int Error(0); | |
int const top = sizeof expected / sizeof *expected; | |
for (int n = 0; n < top; ++n) { | |
int const src = expected[n].src; | |
int const mul = expected[n].mul; | |
int const higher = expected[n].higher; | |
int const got = glm::higherMultiple(src, mul); | |
if (got != higher) { | |
Error += 1; | |
} | |
}; | |
return Error; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment