/
lasersquad
/
LogEngine2
Обзор
Документация
Войти
/
lasersquad
/
LogEngine2
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
prj/Builder/testLogEngine2/Shared.h
76 строк
1 KB
lasersquad@gmail.com
init
02 фев 2024, 20:53
02 фев 2024, 20:53
ee2dd28
Код
Авторство
О чём код?
#pragma once #include <string> #include <iostream> #include <sys/types.h> #include <sys/stat.h> #include <cppunit/extensions/HelperMacros.h> #ifdef WIN32 #define TEST_FILES_FOLDER "..\\..\\..\\test\\testFiles\\" #else #define TEST_FILES_FOLDER "testFiles/" #endif #define LOG_FILES_FOLDER "./logs/" CPPUNIT_NS_BEGIN template<> struct assertion_traits<std::string> // specialization for the std::string type { static bool equal(const std::string& x, const std::string& y) { return x.compare(y) == 0; } static std::string toString(const std::string& x) { return x; } }; template<> struct assertion_traits<const char*> // specialization for the char* type { static bool equal(const char* x, const char* y) { return strcmp(x, y) == 0; } static std::string toString(const char* x) { std::string text; text += '"'; text.append(x); text += '"'; // add quote around the string to see whitespaces CppUnit::OStringStream ost; ost << text; return ost.str(); } }; template<> struct assertion_traits<char*> // specialization for the char* type { static bool equal(char* x, char* y) { return strcmp(x, y) == 0; } static std::string toString(char* x) { std::string text; text += '"'; text.append(x); text += '"'; // add quote around the string to see whitespaces CppUnit::OStringStream ost; ost << text; return ost.str(); } }; CPPUNIT_NS_END std::string millisecToStr(long long ms);