Skip to content

Commit

Permalink
run geometry tests with all data types
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed May 1, 2021
1 parent a33e83f commit 711a316
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions tests/Point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@

// --------------------------------------------------------------------------------------------------------------------

int main()
template <typename T>
static int runTestsPerType()
{
USE_NAMESPACE_DGL;

// basic usage
{
Point<int> p;
Point<T> p;
DISTRHO_ASSERT_EQUAL(p.getX(), 0, "point start X value is 0");
DISTRHO_ASSERT_EQUAL(p.getY(), 0, "point start Y value is 0");

Expand All @@ -40,7 +41,40 @@ int main()
DISTRHO_ASSERT_EQUAL(p.getY(), 7, "point Y value changed to 7");
}

// TODO
return 0;
}

int main()
{
if (const int ret = runTestsPerType<double>())
return ret;

if (const int ret = runTestsPerType<float>())
return ret;

if (const int ret = runTestsPerType<int>())
return ret;

if (const int ret = runTestsPerType<uint>())
return ret;

if (const int ret = runTestsPerType<short>())
return ret;

if (const int ret = runTestsPerType<ushort>())
return ret;

if (const int ret = runTestsPerType<long>())
return ret;

if (const int ret = runTestsPerType<ulong>())
return ret;

if (const int ret = runTestsPerType<long long>())
return ret;

if (const int ret = runTestsPerType<unsigned long long>())
return ret;

return 0;
}
Expand Down

0 comments on commit 711a316

Please sign in to comment.