mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Fix unit test to work with logging
This commit is contained in:
parent
8af86d9f29
commit
825db3567f
2 changed files with 7 additions and 6 deletions
3
test/emul/Logging.cpp
Normal file
3
test/emul/Logging.cpp
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#include "Logging.h"
|
||||||
|
|
||||||
|
Logging logging;
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef LOGGING_H
|
#pragma once
|
||||||
#define LOGGING_H
|
|
||||||
|
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
namespace test {
|
||||||
class Logging {
|
class Logging {
|
||||||
public:
|
public:
|
||||||
static void printf(const char* format, ...) {
|
static void printf(const char* format, ...) {
|
||||||
|
@ -14,11 +14,9 @@ class Logging {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void println(const char* message) { printf("%s\n", message); }
|
static void println(const char* message) { printf("%s\n", message); }
|
||||||
|
|
||||||
static void print(const char* message) { printf("%s", message); }
|
static void print(const char* message) { printf("%s", message); }
|
||||||
};
|
};
|
||||||
|
} // namespace test
|
||||||
|
|
||||||
// Global logging instance
|
using Logging = test::Logging;
|
||||||
extern Logging logging;
|
extern Logging logging;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue