Skip to content

Commit 28e7fd2

Browse files
author
Gonzalo Diaz
committed
Cosmetic code rewrite
1 parent 1a5434b commit 28e7fd2

10 files changed

Lines changed: 57 additions & 25 deletions

src/tests/unit/lib/hackerrank/warmup/a_very_big_sum.test.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
36
#include <exercises/hackerrank/warmup/a_very_big_sum.h>
4-
#include <iostream>
5-
#include <vector>
67

8+
// std libs
79
#include <filesystem>
810
#include <fstream>
9-
#include <nlohmann/json.hpp>
11+
#include <vector>
12+
1013
using json = nlohmann::json;
1114

1215
TEST_CASE("aVeryBigSum JSON Test Cases",

src/tests/unit/lib/hackerrank/warmup/birthday_cake_candles.test.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
36
#include <exercises/hackerrank/warmup/birthday_cake_candles.h>
4-
#include <iostream>
5-
#include <vector>
67

8+
// std libs
79
#include <filesystem>
810
#include <fstream>
9-
#include <nlohmann/json.hpp>
11+
#include <vector>
12+
1013
using json = nlohmann::json;
1114

1215
TEST_CASE("birthdayCakeCandles JSON Test Cases",

src/tests/unit/lib/hackerrank/warmup/compare_triplets.test.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
6+
#ifdef __linux__
37
#include "../../../../tools/memory_injector.hpp"
8+
#endif
49
#include <exercises/hackerrank/warmup/compare_triplets.h>
5-
#include <vector>
610

11+
// std libs
712
#include <filesystem>
813
#include <fstream>
9-
#include <nlohmann/json.hpp>
14+
#include <vector>
15+
1016
using json = nlohmann::json;
1117

1218
TEST_CASE("compareTriplets JSON Test Cases",

src/tests/unit/lib/hackerrank/warmup/diagonal_difference.test.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
36
#include <exercises/hackerrank/warmup/diagonal_difference.h>
4-
#include <iostream>
5-
#include <vector>
67

8+
// std libs
79
#include <filesystem>
810
#include <fstream>
9-
#include <nlohmann/json.hpp>
11+
1012
using json = nlohmann::json;
1113

1214
int **jsonToMatrix(const nlohmann::json &matrixJson, int &rows, int &cols) {

src/tests/unit/lib/hackerrank/warmup/mini_max_sum.test.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
6+
#ifdef __linux__
37
#include "../../../../tools/memory_injector.hpp"
8+
#endif
49
#include <exercises/hackerrank/warmup/mini_max_sum.h>
5-
#include <string>
6-
#include <vector>
710

11+
// std libs
812
#include <filesystem>
913
#include <fstream>
10-
#include <nlohmann/json.hpp>
11-
12-
#include <stdio.h> // malloc
14+
#include <string>
15+
#include <vector>
1316

1417
using json = nlohmann::json;
1518

src/tests/unit/lib/hackerrank/warmup/plus_minus.test.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
6+
#ifdef __linux__
37
#include "../../../../tools/memory_injector.hpp"
8+
#endif
49
#include <exercises/hackerrank/warmup/plus_minus.h>
510

6-
#include <vector>
7-
11+
// std libs
812
#include <filesystem>
913
#include <fstream>
10-
#include <nlohmann/json.hpp>
14+
#include <vector>
15+
1116
using json = nlohmann::json;
1217

1318
TEST_CASE("plusMinus JSON Test Cases", "[hackerrank] [jsontestcase] [warmup]") {

src/tests/unit/lib/hackerrank/warmup/simple_array_sum.test.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
36
#include <exercises/hackerrank/warmup/simple_array_sum.h>
7+
48
#include <filesystem>
59
#include <fstream>
6-
#include <nlohmann/json.hpp>
710
#include <vector>
811

912
using json = nlohmann::json;

src/tests/unit/lib/hackerrank/warmup/solve_me_first.test.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
36
#include <exercises/hackerrank/warmup/solve_me_first.h>
7+
8+
// std libs
49
#include <filesystem>
510
#include <fstream>
6-
#include <nlohmann/json.hpp>
7-
#include <vector>
811

912
using json = nlohmann::json;
1013

src/tests/unit/lib/hackerrank/warmup/staircase.test.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// 3rd party libs
22
#include <catch2/catch_test_macros.hpp>
3-
43
#include <nlohmann/json.hpp>
54

65
// local libs
@@ -12,7 +11,6 @@
1211
// std libs
1312
#include <filesystem>
1413
#include <fstream>
15-
#include <nlohmann/json.hpp>
1614
#include <vector>
1715

1816
using json = nlohmann::json;

src/tests/unit/lib/hackerrank/warmup/time_conversion.test.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
// 3rd party libs
12
#include <catch2/catch_test_macros.hpp>
3+
#include <nlohmann/json.hpp>
24

5+
// local libs
6+
#ifdef __linux__
37
#include "../../../../tools/memory_injector.hpp"
8+
#endif
49
#include <exercises/hackerrank/warmup/time_conversion.h>
10+
11+
// std libs
512
#include <filesystem>
613
#include <fstream>
7-
#include <nlohmann/json.hpp>
814

915
using json = nlohmann::json;
1016

0 commit comments

Comments
 (0)