mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-19 18:40:01 +02:00
WIP
This commit is contained in:
parent
1efacc9475
commit
3431752649
@ -17,7 +17,8 @@ Checks: '*,
|
|||||||
-google-runtime-references,
|
-google-runtime-references,
|
||||||
-google-readability-todo,
|
-google-readability-todo,
|
||||||
-google-readability-braces-around-statements,
|
-google-readability-braces-around-statements,
|
||||||
-modernize-use-trailing-return-type'
|
-modernize-use-trailing-return-type,
|
||||||
|
-readability-isolate-declaration'
|
||||||
|
|
||||||
HeaderFilterRegex: \.h
|
HeaderFilterRegex: \.h
|
||||||
AnalyzeTemporaryDtors: false
|
AnalyzeTemporaryDtors: false
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
#ifdef FIFODEBUG
|
#ifdef FIFODEBUG
|
||||||
@ -22,8 +22,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define STRINGIFY(x) #x
|
// #define STRINGIFY(x) #x
|
||||||
#define TOSTRING(x) STRINGIFY(x)
|
// #define TOSTRING(x) STRINGIFY(x)
|
||||||
#define MYCONCAT(x,y)
|
#define MYCONCAT(x,y)
|
||||||
#define __AT__ std::string(__FILE__) + std::string("::") + std::string(__func__) + std::string("(): ")
|
#define __AT__ std::string(__FILE__) + std::string("::") + std::string(__func__) + std::string("(): ")
|
||||||
#define __SHORT_FORM_OF_FILE__ \
|
#define __SHORT_FORM_OF_FILE__ \
|
||||||
@ -162,13 +162,23 @@ inline FILE*& Output2FILE::Stream()
|
|||||||
return pStream;
|
return pStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// inline void Output2FILE::Output(const std::string& msg)
|
||||||
|
// {
|
||||||
|
// FILE* pStream = Stream();
|
||||||
|
// if (!pStream)
|
||||||
|
// return;
|
||||||
|
// fprintf(pStream, "%s", msg.c_str());
|
||||||
|
// fflush(pStream);
|
||||||
|
// }
|
||||||
|
|
||||||
inline void Output2FILE::Output(const std::string& msg)
|
inline void Output2FILE::Output(const std::string& msg)
|
||||||
{
|
{
|
||||||
FILE* pStream = Stream();
|
std::cout << msg;
|
||||||
if (!pStream)
|
// FILE* pStream = Stream();
|
||||||
return;
|
// if (!pStream)
|
||||||
fprintf(pStream, "%s", msg.c_str());
|
// return;
|
||||||
fflush(pStream);
|
// fprintf(pStream, "%s", msg.c_str());
|
||||||
|
// fflush(pStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Output2FILE::Output(const std::string& msg, TLogLevel level)
|
inline void Output2FILE::Output(const std::string& msg, TLogLevel level)
|
||||||
|
@ -9,4 +9,5 @@ target_sources(tests PRIVATE
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/test-ToString.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/test-ToString.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/test-TypeTraits.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/test-TypeTraits.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/test-UdpRxSocket.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/test-UdpRxSocket.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/test-logger.cpp
|
||||||
)
|
)
|
16
slsSupportLib/tests/test-logger.cpp
Normal file
16
slsSupportLib/tests/test-logger.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include "catch.hpp"
|
||||||
|
#include "logger.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
TEST_CASE("fail"){
|
||||||
|
|
||||||
|
FILE_LOG(logINFO) << "A message";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// CHECK(false);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user