From f78872378601c163129c6b29bb91de70ec9faac9 Mon Sep 17 00:00:00 2001 From: wsnipex Date: Wed, 24 Sep 2014 11:20:42 +0200 Subject: [PATCH] [gtests] fix logfile related tests after rename --- xbmc/utils/test/TestRegExp.cpp | 6 +++++- xbmc/utils/test/Testlog.cpp | 14 +++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/xbmc/utils/test/TestRegExp.cpp b/xbmc/utils/test/TestRegExp.cpp index 89bb34c37015a..e4231afa29db7 100644 --- a/xbmc/utils/test/TestRegExp.cpp +++ b/xbmc/utils/test/TestRegExp.cpp @@ -28,6 +28,8 @@ #include "utils/StdString.h" #include "filesystem/File.h" #include "filesystem/SpecialProtocol.h" +#include "utils/StringUtils.h" +#include "CompileInfo.h" TEST(TestRegExp, RegFind) { @@ -151,7 +153,9 @@ TEST_F(TestRegExpLog, DumpOvector) unsigned int bytesread; XFILE::CFile file; - logfile = CSpecialProtocol::TranslatePath("special://temp/") + "xbmc.log"; + std::string appName = CCompileInfo::GetAppName(); + StringUtils::ToLower(appName); + logfile = CSpecialProtocol::TranslatePath("special://temp/") + appName + ".log"; EXPECT_TRUE(CLog::Init(CSpecialProtocol::TranslatePath("special://temp/").c_str())); EXPECT_TRUE(XFILE::CFile::Exists(logfile)); diff --git a/xbmc/utils/test/Testlog.cpp b/xbmc/utils/test/Testlog.cpp index ebcbd91c0b6e7..656201f959f46 100644 --- a/xbmc/utils/test/Testlog.cpp +++ b/xbmc/utils/test/Testlog.cpp @@ -23,6 +23,8 @@ #include "filesystem/File.h" #include "filesystem/SpecialProtocol.h" #include "utils/StdString.h" +#include "utils/StringUtils.h" +#include "CompileInfo.h" #include "test/TestUtils.h" @@ -46,7 +48,9 @@ TEST_F(Testlog, Log) XFILE::CFile file; CRegExp regex; - logfile = CSpecialProtocol::TranslatePath("special://temp/") + "xbmc.log"; + std::string appName = CCompileInfo::GetAppName(); + StringUtils::ToLower(appName); + logfile = CSpecialProtocol::TranslatePath("special://temp/") + appName + ".log"; EXPECT_TRUE(CLog::Init(CSpecialProtocol::TranslatePath("special://temp/").c_str())); EXPECT_TRUE(XFILE::CFile::Exists(logfile)); @@ -100,7 +104,9 @@ TEST_F(Testlog, MemDump) CRegExp regex; char refdata[] = "0123456789abcdefghijklmnopqrstuvwxyz"; - logfile = CSpecialProtocol::TranslatePath("special://temp/") + "xbmc.log"; + std::string appName = CCompileInfo::GetAppName(); + StringUtils::ToLower(appName); + logfile = CSpecialProtocol::TranslatePath("special://temp/") + appName + ".log"; EXPECT_TRUE(CLog::Init(CSpecialProtocol::TranslatePath("special://temp/").c_str())); EXPECT_TRUE(XFILE::CFile::Exists(logfile)); @@ -132,7 +138,9 @@ TEST_F(Testlog, SetLogLevel) { CStdString logfile; - logfile = CSpecialProtocol::TranslatePath("special://temp/") + "xbmc.log"; + std::string appName = CCompileInfo::GetAppName(); + StringUtils::ToLower(appName); + logfile = CSpecialProtocol::TranslatePath("special://temp/") + appName + ".log"; EXPECT_TRUE(CLog::Init(CSpecialProtocol::TranslatePath("special://temp/").c_str())); EXPECT_TRUE(XFILE::CFile::Exists(logfile));