Skip to content

Commit

Permalink
mv CHECK() to testUtils.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultLejemble committed Dec 5, 2023
1 parent f8900b4 commit 9de1f90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 9 additions & 0 deletions tests/common/testUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,12 @@ typename DataPoint::Scalar getKappaMean(const std::vector<DataPoint>& _vectorPoi

return kappaMean / nbNei;
}

// compile-time and run-time check if a given value is true or false
// this template function is required because "Outside a template, a discarded
// statement is fully checked." (cppreference.com/w/cpp/language/if)
template<bool b>
void CHECK() {
static_assert(b);
VERIFY(b);
}
9 changes: 0 additions & 9 deletions tests/src/capability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@ using DataPoint = PointPosition<float, Dim>;
using Kernel = ConstantWeightKernel<float>;
using WeightFunc = DistWeightFunc<DataPoint, Kernel>;

// compile-time and run-time check if a given value is true or false
// this template function is required because "Outside a template, a discarded
// statement is fully checked." (cppreference.com/w/cpp/language/if)
template<bool b>
void CHECK() {
static_assert(b);
VERIFY(b);
}

// extension that test if PLANE is provided
template<class P, class W, typename T>
class InitTestExtensionPlane : public T
Expand Down

0 comments on commit 9de1f90

Please sign in to comment.