Skip to content

Commit 7de9f3b

Browse files
committed
2 parents 11a0ab1 + 59fd0f8 commit 7de9f3b

File tree

4 files changed

+4
-22
lines changed

4 files changed

+4
-22
lines changed

src/day_2.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ namespace AdventOfCode24::Day2 {
3434
values.end(),
3535
[&overall_trend](int a, int b) {
3636
if(a == b || std::abs(a - b) > 3 || std::abs(a - b) < 1){
37-
spdlog::warn("Invalid interval of size " + std::to_string(a - b));
37+
spdlog::debug("Invalid interval of size " + std::to_string(a - b));
3838
return true;
3939
}
4040
if((overall_trend > 0 && a > b) || (overall_trend < 0 && a < b)) {
41-
spdlog::warn("Interval of [" + std::to_string(a) + "," + std::to_string(b) + "] does not match " + ((overall_trend < 0) ? "negative" : "positive") + " trend");
41+
spdlog::debug("Interval of [" + std::to_string(a) + "," + std::to_string(b) + "] does not match " + ((overall_trend < 0) ? "negative" : "positive") + " trend");
4242
return true;
4343
}
4444
return false;
@@ -64,7 +64,7 @@ namespace AdventOfCode24::Day2 {
6464

6565
// If the general trend is zero this is failure
6666
if(!general_trend) {
67-
spdlog::warn("No general direction found.");
67+
spdlog::debug("No general direction found.");
6868
return false;
6969
}
7070

@@ -112,7 +112,7 @@ namespace AdventOfCode24::Day2 {
112112
spdlog::debug("Line " + std::string((safe_reports[safe_reports.size() - 1]) ? "Passed" : "Failed"));
113113
}
114114

115-
spdlog::info("Processed " + std::to_string(safe_reports.size()) + " layers.");
115+
spdlog::debug("Processed " + std::to_string(safe_reports.size()) + " layers.");
116116

117117
return safe_reports;
118118
}

tests/test_day_2.cxx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ TEST(TestAOC, TestDay2pt1_valid) {
5050
}
5151

5252
TEST(TestAOC, TestDay2pt1_file1) {
53-
spdlog::set_level(spdlog::level::debug);
5453
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / "day_2_1.txt";
5554

5655
const std::vector<bool> layer_safety = AdventOfCode24::Day2::check_reactor_safety(input_file, false);
@@ -63,7 +62,6 @@ TEST(TestAOC, TestDay2pt1_file1) {
6362
}
6463

6564
TEST(TestAOC, TestDay2pt1) {
66-
spdlog::set_level(spdlog::level::debug);
6765
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / ".." / ".." / "solutions" / "data" / "day_2.txt";
6866

6967
const std::vector<bool> layer_safety = AdventOfCode24::Day2::check_reactor_safety(input_file, false);
@@ -76,8 +74,6 @@ TEST(TestAOC, TestDay2pt1) {
7674
}
7775

7876
TEST(TestAOC, TestDay2pt2_file1) {
79-
spdlog::set_level(spdlog::level::debug);
80-
8177
std::vector<bool> expected{true, false, false, true, true, true};
8278
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / "day_2_1.txt";
8379
int index{0};
@@ -99,8 +95,6 @@ TEST(TestAOC, TestDay2pt2_file1) {
9995
}
10096

10197
TEST(TestAOC, TestDay2pt2_file2) {
102-
spdlog::set_level(spdlog::level::debug);
103-
10498
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / "day_2_2.txt";
10599
int index{0};
106100

@@ -123,8 +117,6 @@ TEST(TestAOC, TestDay2pt2_file2) {
123117
}
124118

125119
TEST(TestAOC, TestDay2pt2) {
126-
spdlog::set_level(spdlog::level::debug);
127-
128120
std::vector<bool> expected{true, false, false, true, true, true};
129121
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / ".." / ".." / "solutions" / "data" / "day_2.txt";
130122
int index{0};

tests/test_day_3.cxx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ TEST(TestAOC, TestDay3pt1_line_parse) {
2525
}
2626

2727
TEST(TestAOC, TestDay3pt1_example) {
28-
spdlog::set_level(spdlog::level::debug);
2928
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / "day_3_1.txt";
3029
const std::vector<int> line_totals{AdventOfCode24::Day3::calculate_file_lines(input_file, false)};
3130

@@ -36,7 +35,6 @@ TEST(TestAOC, TestDay3pt1_example) {
3635
}
3736

3837
TEST(TestAOC, TestDay3pt2_example) {
39-
spdlog::set_level(spdlog::level::debug);
4038
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / "day_3_2.txt";
4139
const std::vector<int> line_totals{AdventOfCode24::Day3::calculate_file_lines(input_file, true)};
4240

@@ -47,7 +45,6 @@ TEST(TestAOC, TestDay3pt2_example) {
4745
}
4846

4947
TEST(TestAOC, TestDay3pt1) {
50-
spdlog::set_level(spdlog::level::debug);
5148
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / ".." / ".." / "solutions" / "data" / "day_3.txt";
5249
const std::vector<int> line_totals{AdventOfCode24::Day3::calculate_file_lines(input_file, false)};
5350

@@ -57,7 +54,6 @@ TEST(TestAOC, TestDay3pt1) {
5754
}
5855

5956
TEST(TestAOC, TestDay3pt2) {
60-
spdlog::set_level(spdlog::level::debug);
6157
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / ".." / ".." / "solutions" / "data" / "day_3.txt";
6258
const std::vector<int> line_totals{AdventOfCode24::Day3::calculate_file_lines(input_file, true)};
6359

@@ -67,7 +63,6 @@ TEST(TestAOC, TestDay3pt2) {
6763
}
6864

6965
TEST(TestAOC, TestDay3pt2_scenario_1) {
70-
spdlog::set_level(spdlog::level::debug);
7166
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / "day_3_3.txt";
7267
const std::vector<int> line_totals{AdventOfCode24::Day3::calculate_file_lines(input_file, true)};
7368

tests/test_day_5.cxx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ using namespace AdventOfCode24::Day5;
1414
#endif
1515

1616
TEST(TestAOC, TestDay5pt1_parse_rule) {
17-
spdlog::set_level(spdlog::level::debug);
1817
const std::string test_line("34|78");
1918
const std::optional<std::pair<int, int>> rule{parse_rule(test_line, '|')};
2019
const std::pair<int, int> expected{34,78};
@@ -40,7 +39,6 @@ TEST(TestAOC, TestDay5pt1_sequence_check_fail) {
4039
}
4140

4241
TEST(TestAOC, TestDay5pt1_example) {
43-
spdlog::set_level(spdlog::level::debug);
4442
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / "day_5_1.txt";
4543
const std::vector<int> middle_values{process_file(input_file, '|', ',')};
4644
const std::vector<int> expected{61, 53, 29, 0, 0, 0};
@@ -53,7 +51,6 @@ TEST(TestAOC, TestDay5pt1_example) {
5351
}
5452

5553
TEST(TestAOC, TestDay5pt2_example) {
56-
spdlog::set_level(spdlog::level::debug);
5754
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / "day_5_1.txt";
5855
const std::vector<int> middle_values{process_file(input_file, '|', ',', true)};
5956
const std::vector<int> expected{0, 0, 0, 47, 29, 47};
@@ -66,7 +63,6 @@ TEST(TestAOC, TestDay5pt2_example) {
6663
}
6764

6865
TEST(TestAOC, TestDay5pt1) {
69-
spdlog::set_level(spdlog::level::debug);
7066
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / ".." / ".." / "solutions" / "data" / "day_5.txt";
7167
const std::vector<int> middle_values{process_file(input_file, '|', ',')};
7268

@@ -76,7 +72,6 @@ TEST(TestAOC, TestDay5pt1) {
7672
}
7773

7874
TEST(TestAOC, TestDay5pt2) {
79-
spdlog::set_level(spdlog::level::debug);
8075
const std::filesystem::path input_file = std::filesystem::path(ADVENT_OF_CODE_DATA) / ".." / ".." / "solutions" / "data" / "day_5.txt";
8176
const std::vector<int> middle_values{process_file(input_file, '|', ',', true)};
8277

0 commit comments

Comments
 (0)