fix: unit tests fixed for DOWNCAST_MODE = OFF

This commit is contained in:
Mateusz Pusz
2020-09-10 11:33:58 +02:00
parent d24363af98
commit 58daacfd58
7 changed files with 49 additions and 16 deletions
+1 -3
View File
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#include "test_tools.h"
#include "units/math.h"
#include "units/physical/international/area.h"
#include "units/physical/si/area.h"
@@ -33,9 +34,6 @@ using namespace units;
using namespace units::physical::si::literals;
using namespace units::physical::international::literals;
template<typename T, typename U>
inline constexpr bool compare = DOWNCAST_MODE != 0 ? is_same_v<T, U> : (is_same_v<T, U> || units::equivalent<T, U>);
static_assert(compare<decltype(pow<0>(2_q_m)), std::int64_t>);
static_assert(compare<decltype(pow<1>(2_q_m)), decltype(2_q_m)>);
static_assert(compare<decltype(pow<2>(2_q_m)), decltype(4_q_m2)>);