Browse Source

Math: fix Clang "unused but set" warnings in benchmarks.

pull/525/head
Vladimír Vondruš 4 years ago
parent
commit
39d482cceb
  1. 8
      src/Magnum/Math/Test/FunctionsBenchmark.cpp
  2. 3
      src/Magnum/Math/Test/InterpolationBenchmark.cpp

8
src/Magnum/Math/Test/FunctionsBenchmark.cpp

@ -201,6 +201,10 @@ void FunctionsBenchmark::sinCosSeparate() {
}
CORRADE_COMPARE_AS(a, 10.0f, Corrade::TestSuite::Compare::Greater);
/* To avoid the whole loop being optimized away */
CORRADE_VERIFY(sin == sin);
CORRADE_VERIFY(cos == cos);
}
void FunctionsBenchmark::sinCosCombined() {
@ -213,6 +217,10 @@ void FunctionsBenchmark::sinCosCombined() {
}
CORRADE_COMPARE_AS(a, 10.0f, Corrade::TestSuite::Compare::Greater);
/* To avoid the whole loop being optimized away */
CORRADE_VERIFY(sin == sin);
CORRADE_VERIFY(cos == cos);
}

3
src/Magnum/Math/Test/InterpolationBenchmark.cpp

@ -70,6 +70,9 @@ void InterpolationBenchmark::baseline() {
}
CORRADE_VERIFY(!c.isNormalized());
/* To avoid "unused but set" warnings */
CORRADE_VERIFY(t == t);
}
void InterpolationBenchmark::quaternionLerp() {

Loading…
Cancel
Save