1- // Trick to let the code compile, even if the function has not been implemented:
2- namespace estate_executor {
3- int assemble_account_number (int ) __attribute__((weak));
4- int assemble_code () __attribute__((weak));
5- }
6-
71#include " last_will.cpp"
82#ifdef EXERCISM_TEST_SUITE
93#include < catch2/catch.hpp>
@@ -14,9 +8,9 @@ namespace estate_executor {
148using namespace std ;
159
1610TEST_CASE (" Family secrets have not been altered" , " [task_1]" ) {
17- // We cannot test the existence of a namespace in the compiled
11+ // We cannot test the existence of a namespace in the compiled
1812 // Code.
19- // This test merely checks if the numbers in the file have
13+ // This test merely checks if the numbers in the file have
2014 // been changed. They have to be correct for the test to work.
2115
2216 REQUIRE (zhang::bank_number_part (1 ) == 8541 );
@@ -35,7 +29,8 @@ TEST_CASE("Family secrets have not been altered", "[task_1]") {
3529 REQUIRE (garcia::blue::code_fragment () == 923 );
3630}
3731
38- TEST_CASE (" Account number assembly function exists in correct namespace" , " [task_2]" ) {
32+ TEST_CASE (" Account number assembly function exists in correct namespace" ,
33+ " [task_2]" ) {
3934 REQUIRE_NOTHROW (estate_executor::assemble_account_number (0 ));
4035}
4136
@@ -45,11 +40,14 @@ TEST_CASE("Account number assembly works correctly", "[task_2]") {
4540 int account_with_secret_1{16706 };
4641 int account_with_secret_23{14238 };
4742
48- REQUIRE (estate_executor::assemble_account_number (1 ) == account_with_secret_1);
49- REQUIRE (estate_executor::assemble_account_number (23 ) == account_with_secret_23);
43+ REQUIRE (estate_executor::assemble_account_number (1 ) ==
44+ account_with_secret_1);
45+ REQUIRE (estate_executor::assemble_account_number (23 ) ==
46+ account_with_secret_23);
5047}
5148
52- TEST_CASE (" Code fragment number assembly function exists in correct namespace" , " [task_3]" ) {
49+ TEST_CASE (" Code fragment number assembly function exists in correct namespace" ,
50+ " [task_3]" ) {
5351 REQUIRE_NOTHROW (estate_executor::assemble_code ());
5452}
5553
0 commit comments