Unit tests for difficulty_type

This commit is contained in:
SChernykh
2021-09-03 11:12:22 +02:00
parent b26c4616d7
commit 2d8530798d
7 changed files with 400 additions and 0 deletions

View File

@@ -234,7 +234,9 @@ private:
std::ofstream m_logFile;
};
#ifndef P2POOL_LOG_DISABLE
static Worker worker;
#endif
NOINLINE Writer::Writer(Severity severity) : Stream(m_stackBuf)
{
@@ -252,7 +254,9 @@ NOINLINE Writer::~Writer()
m_buf[1] = static_cast<uint8_t>(size & 255);
m_buf[2] = static_cast<uint8_t>(size >> 8);
m_buf[m_pos] = '\n';
#ifndef P2POOL_LOG_DISABLE
worker.write(m_buf, size);
#endif
}
void reopen()
@@ -263,7 +267,9 @@ void reopen()
void stop()
{
#ifndef P2POOL_LOG_DISABLE
worker.stop();
#endif
}
NOINLINE void Stream::writeCurrentTime()

View File

@@ -384,6 +384,14 @@ namespace {
#define CONCAT(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a##b
#ifdef P2POOL_LOG_DISABLE
#define LOGINFO(level, ...)
#define LOGWARN(level, ...)
#define LOGERR(level, ...)
#else
#define LOG(level, severity, ...) \
do { \
if (level <= log::GLOBAL_LOG_LEVEL) { \
@@ -398,6 +406,8 @@ namespace {
#define LOGWARN(level, ...) LOG(level, log::Severity::Warning, __VA_ARGS__)
#define LOGERR(level, ...) LOG(level, log::Severity::Error, __VA_ARGS__)
#endif
void reopen();
void stop();