summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-05 14:20:15 -0500
committerbd <bdunahu@operationnull.com>2025-03-05 14:20:15 -0500
commite296a3a6ab782cb80b7091324b41bb78db6d3906 (patch)
treeaf137790ab40290d1cc4e83f3261370c591512bc /tests
parentdb158de830e4fd4ab20ef5d357e24147c7a9281d (diff)
whitespace
Diffstat (limited to 'tests')
-rw-r--r--tests/cache.cc4
-rw-r--r--tests/dram.cc4
-rw-r--r--tests/logger.cc66
3 files changed, 37 insertions, 37 deletions
diff --git a/tests/cache.cc b/tests/cache.cc
index df5004a..6580563 100644
--- a/tests/cache.cc
+++ b/tests/cache.cc
@@ -3,6 +3,6 @@
TEST_CASE("Constructor initialize test 1", "[cache]")
{
- Cache *c = new Cache(1, nullptr, 4);
- delete c;
+ Cache *c = new Cache(1, nullptr, 4);
+ delete c;
}
diff --git a/tests/dram.cc b/tests/dram.cc
index 1bde0fd..21182f8 100644
--- a/tests/dram.cc
+++ b/tests/dram.cc
@@ -3,6 +3,6 @@
TEST_CASE("Constructor initialize test 1", "[dram]")
{
- Dram *d = new Dram(1, 4);
- delete d;
+ Dram *d = new Dram(1, 4);
+ delete d;
}
diff --git a/tests/logger.cc b/tests/logger.cc
index e2f72a5..711dd0e 100644
--- a/tests/logger.cc
+++ b/tests/logger.cc
@@ -6,60 +6,60 @@
TEST_CASE("Logger logs higher log level", "[logger]")
{
- std::streambuf *coutBuffer = std::cout.rdbuf();
- std::ostringstream oss;
- std::cout.rdbuf(oss.rdbuf());
+ std::streambuf *coutBuffer = std::cout.rdbuf();
+ std::ostringstream oss;
+ std::cout.rdbuf(oss.rdbuf());
- Logger logger("");
- logger.setLevel(INFO);
+ Logger logger("");
+ logger.setLevel(INFO);
- logger.log(ERROR, "foo bar baz qux");
+ logger.log(ERROR, "foo bar baz qux");
- std::cout.rdbuf(coutBuffer);
+ std::cout.rdbuf(coutBuffer);
- std::string actual = oss.str();
- std::regex expected(
- "\\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\] ERROR: "
- "foo bar baz qux\\n");
+ std::string actual = oss.str();
+ std::regex expected(
+ "\\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\] ERROR: "
+ "foo bar baz qux\\n");
- REQUIRE(std::regex_match(actual, expected));
+ REQUIRE(std::regex_match(actual, expected));
}
TEST_CASE("Logger logs equal log level", "[logger]")
{
- std::streambuf *coutBuffer = std::cout.rdbuf();
- std::ostringstream oss;
- std::cout.rdbuf(oss.rdbuf());
+ std::streambuf *coutBuffer = std::cout.rdbuf();
+ std::ostringstream oss;
+ std::cout.rdbuf(oss.rdbuf());
- Logger logger("");
- logger.setLevel(INFO);
+ Logger logger("");
+ logger.setLevel(INFO);
- logger.log(INFO, "foo bar baz qux");
+ logger.log(INFO, "foo bar baz qux");
- std::cout.rdbuf(coutBuffer);
+ std::cout.rdbuf(coutBuffer);
- std::string actual = oss.str();
- std::regex expected("\\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\] INFO: "
- "foo bar baz qux\\n");
+ std::string actual = oss.str();
+ std::regex expected("\\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\] INFO: "
+ "foo bar baz qux\\n");
- REQUIRE(std::regex_match(actual, expected));
+ REQUIRE(std::regex_match(actual, expected));
}
TEST_CASE("Logger ignores lower log level", "[logger]")
{
- std::streambuf *coutBuffer = std::cout.rdbuf();
- std::ostringstream oss;
- std::cout.rdbuf(oss.rdbuf());
+ std::streambuf *coutBuffer = std::cout.rdbuf();
+ std::ostringstream oss;
+ std::cout.rdbuf(oss.rdbuf());
- Logger logger("");
- logger.setLevel(INFO);
+ Logger logger("");
+ logger.setLevel(INFO);
- logger.log(DEBUG, "foo bar baz qux");
+ logger.log(DEBUG, "foo bar baz qux");
- std::cout.rdbuf(coutBuffer);
+ std::cout.rdbuf(coutBuffer);
- std::string actual = oss.str();
- std::string expected("");
+ std::string actual = oss.str();
+ std::string expected("");
- REQUIRE(actual == expected);
+ REQUIRE(actual == expected);
}