blob: cdc72752179238c31906645a5f2400bc5adbb839 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#include "2022/day1/aoc.h"
#include "2022/day2/aoc.h"
#include "2022/day3/aoc.h"
#include "2022/day4/aoc.h"
#include "2022/day5/aoc.h"
#include "2022/day6/aoc.h"
#include "catch.hpp"
#include <stdio.h>
#include <string.h>
TEST_CASE("Calorie Counting", "[2022]") {
line_view lv = load_file("../src/2022/day1/input");
auto p = aoc2022::day1(lv);
REQUIRE(69693 == p.first);
REQUIRE(200945 == p.second);
}
TEST_CASE("Rock Paper Scissors", "[2022]") {
line_view lv = load_file("../src/2022/day2/input");
auto p = aoc2022::day2(lv);
REQUIRE(17189 == p.first);
REQUIRE(13490 == p.second);
}
TEST_CASE("Rucksack Reorganization", "[2022]") {
line_view lv = load_file("../src/2022/day3/input");
auto p = aoc2022::day3(lv);
REQUIRE(8185 == p.first);
REQUIRE(2817 == p.second);
}
TEST_CASE("Camp Cleanup", "[2022]") {
line_view lv = load_file("../src/2022/day4/input");
auto p = aoc2022::day4(lv);
REQUIRE(431 == p.first);
REQUIRE(823 == p.second);
}
TEST_CASE("Supply Stacks", "[2022]") {
line_view lv = load_file("../src/2022/day5/input");
char message[10] = {0};
aoc2022::day5(lv, message, 1);
REQUIRE(strcmp(message,"JCMHLVGMG") == 0);
aoc2022::day5(lv, message, 2);
REQUIRE(strcmp(message,"LVMRWSSPZ") == 0);
}
TEST_CASE("Tuning Trouble", "[2022]") {
line_view lv = load_file("../src/2022/day6/input");
auto p = aoc2022::day6(lv);
REQUIRE(1623 == p.first);
REQUIRE(3774 == p.second);
}
|