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
-
7
1
#include " last_will.cpp"
8
2
#ifdef EXERCISM_TEST_SUITE
9
3
#include < catch2/catch.hpp>
@@ -14,9 +8,9 @@ namespace estate_executor {
14
8
using namespace std ;
15
9
16
10
TEST_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
18
12
// 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
20
14
// been changed. They have to be correct for the test to work.
21
15
22
16
REQUIRE (zhang::bank_number_part (1 ) == 8541 );
@@ -35,7 +29,8 @@ TEST_CASE("Family secrets have not been altered", "[task_1]") {
35
29
REQUIRE (garcia::blue::code_fragment () == 923 );
36
30
}
37
31
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]" ) {
39
34
REQUIRE_NOTHROW (estate_executor::assemble_account_number (0 ));
40
35
}
41
36
@@ -45,11 +40,14 @@ TEST_CASE("Account number assembly works correctly", "[task_2]") {
45
40
int account_with_secret_1{16706 };
46
41
int account_with_secret_23{14238 };
47
42
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);
50
47
}
51
48
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]" ) {
53
51
REQUIRE_NOTHROW (estate_executor::assemble_code ());
54
52
}
55
53
0 commit comments