Skip to content

Commit

Permalink
Merge pull request #16 from wsnipex/rebrand
Browse files Browse the repository at this point in the history
[gtests] fix logfile related tests after rename
  • Loading branch information
Memphiz committed Sep 24, 2014
2 parents dbf5f01 + f788723 commit bcbf192
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion xbmc/utils/test/TestRegExp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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));

Expand Down
14 changes: 11 additions & 3 deletions xbmc/utils/test/Testlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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));

Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit bcbf192

Please sign in to comment.