From 6193bb8546f743f43dfc2b0fd1014a72ab356e4d Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 2 Jan 2020 13:32:50 +0100 Subject: new_type: fix compound-add unit tests --- test/src/arithmetic_suite.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/src/arithmetic_suite.cpp b/test/src/arithmetic_suite.cpp index 5d760d2..7de76d6 100644 --- a/test/src/arithmetic_suite.cpp +++ b/test/src/arithmetic_suite.cpp @@ -215,10 +215,10 @@ inline namespace compound_addition -> void { using type_alias = nt::new_type; - auto lhs = type_alias{24}; - auto rhs = type_alias{18}; auto elhs = 42; auto erhs = 18; + auto lhs = type_alias{elhs}; + auto rhs = type_alias{erhs}; ASSERT_EQUAL(elhs += erhs, (lhs += rhs).decay()); } @@ -259,6 +259,11 @@ auto arithmetic_suite() -> std::pair KAWAII(a_new__type_deriving_arithmetic_is_dividable_with_instances_of_itself_if_the_base_type_is_dividable), KAWAII(division_of_two_instances_of_a_new__type_deriving_arithmetic_produces_an_instance_of_the_same_new__type), KAWAII(division_of_two_instances_of_a_new__type_deriving_arithmetic_produces_the_correct_value_with_respect_to_the_base_type), + + /// Compound Addition Tests + KAWAII(addition_assignment_of_two_instances_of_a_new__type_deriving_arithmetic_produces_an_instance_of_the_same_new__type), + KAWAII( + addition_assignment_of_two_instances_of_a_new__type_deriving_arithmetic_produces_the_correct_value_with_respect_to_the_base_type), }, "Arithmetic Operators Tests"}; } \ No newline at end of file -- cgit v1.2.3