Skip to content

Instantly share code, notes, and snippets.

@muep
Created February 21, 2013 23:29
Show Gist options
  • Save muep/5009424 to your computer and use it in GitHub Desktop.
Save muep/5009424 to your computer and use it in GitHub Desktop.
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