Unit tests with useless casts refactored

This commit is contained in:
Mateusz Pusz
2019-05-08 11:19:33 -06:00
parent 9000a0206e
commit 863a14ed36

View File

@@ -112,7 +112,7 @@ namespace {
static_assert(length<meter, int>(km).count() == 1000);
// static_assert(length<meter, int>(length<meter, double>(3.14)).count() == 3); // should not compile
static_assert(length<meter, int>(quantity_cast<length<meter, int>>(3.14_m)).count() == 3);
static_assert(length<meter, int>(quantity_cast<length<meter, my_value<int>>>(3.14_m)).count() == 3);
// static_assert(length<meter, int>(length<meter, my_value<double>>(1000.0)).count() == 1000); // should not compile
// static_assert(length<meter, my_value>(1000.0_m).count() == 1000); // should not compile
static_assert(length<meter, double>(1000.0_m).count() == 1000.0);
@@ -123,7 +123,7 @@ namespace {
static_assert(length<meter, int>(1_km).count() == 1000);
// static_assert(length<meter, int>(1_s).count() == 1); // should not compile
// static_assert(length<kilometer, int>(1010_m).count() == 1); // should not compile
static_assert(length<kilometer, int>(quantity_cast<length<kilometer, int>>(1010_m)).count() == 1);
static_assert(length<kilometer, int>(quantity_cast<length<kilometer, my_value<int>>>(1010_m)).count() == 1);
// assignment operator