Index: src/libchcore/Tests/TestsTConfig.cpp =================================================================== diff -u -rc07c70176303cf99b068daacd0a1b7adc9d131d3 -r09f1dd01c80a2c14e7b3c8531356a60ce5a6a801 --- src/libchcore/Tests/TestsTConfig.cpp (.../TestsTConfig.cpp) (revision c07c70176303cf99b068daacd0a1b7adc9d131d3) +++ src/libchcore/Tests/TestsTConfig.cpp (.../TestsTConfig.cpp) (revision 09f1dd01c80a2c14e7b3c8531356a60ce5a6a801) @@ -3,6 +3,7 @@ #include "gmock/gmock.h" #include #include +#include #include #include "../TConfig.h" #include "../TStringArray.h" @@ -34,7 +35,7 @@ std::wofstream outFile(m_strTempFilePath.c_str(), std::wofstream::out | std::wofstream::binary); - std::locale utf8locale(std::locale(), new std::codecvt_byname ("en_US.UTF-8")); + std::locale utf8locale(std::locale(), new std::codecvt_utf8); outFile.imbue(utf8locale); std::wstring wstrData = @@ -46,7 +47,7 @@ \ true\ <WINDOWS>\\media\\chord.wav\ - <WINDOWS>\\media\\ding.wav\ + <WINDOWS>\\\x597D\x8FD0\\ding.wav\ \ \ c:\\Windows\\System32\ @@ -94,7 +95,7 @@ \ true\ <WINDOWS>\\media\\chord.wav\ - <WINDOWS>\\media\\ding.wav\ + <WINDOWS>\\\x597D\x8FD0\\ding.wav\ \ \ c:\\Windows\\System32\ @@ -133,15 +134,15 @@ EXPECT_EQ(true, cfg.GetBool(_T("CHConfig.Core.Notifications.Sounds.Enable"), false)); EXPECT_EQ(30000, cfg.GetInt(_T("CHConfig.Core.AutosaveInterval"), 0)); - EXPECT_EQ(TString(_T("\\media\\ding.wav")), cfg.GetString(_T("CHConfig.Core.Notifications.Sounds.FinishedSoundPath"), _T(""))); + EXPECT_EQ(TString(_T("\\\x597D\x8FD0\\ding.wav")), cfg.GetString(_T("CHConfig.Core.Notifications.Sounds.FinishedSoundPath"), _T(""))); } TEST(TConfigTests, WriteToFile) { TConfig cfg; cfg.SetValue(_T("CHConfig.Core.Notifications.Sounds.Enable"), true); cfg.SetValue(_T("CHConfig.Core.AutosaveInterval"), 10000); - cfg.SetValue(_T("CHConfig.Core.Notifications.Sounds.FinishedSoundPath"), _T("c:\\Users\\NewUser")); + cfg.SetValue(_T("CHConfig.Core.Notifications.Sounds.FinishedSoundPath"), _T("c:\\Users\\\x597D\x8FD0")); std::wstring strPath(GetTmpPath()); cfg.SetFilePath(strPath.c_str()); @@ -151,7 +152,7 @@ std::wstring wstrData; std::wifstream inFile(strPath.c_str(), std::wofstream::in | std::wofstream::binary); - std::locale utf8locale(std::locale(), new std::codecvt_byname ("en_US.UTF-8")); + std::locale utf8locale(std::locale(), new std::codecvt_utf8); inFile.imbue(utf8locale); std::wstringstream wstrStream; @@ -164,7 +165,8 @@ boost::replace_all(wstrData, _T("\r\n"), _T("\n")); EXPECT_EQ(_T("\n\ -10000truec:\\Users\\NewUser"), wstrData); +10000truec:\\Users\\\x597D\x8FD0"), +wstrData); } /////////////////////////////////////////////////////////////////////////// @@ -173,7 +175,7 @@ { EXPECT_EQ(true, m_cfg.GetBool(_T("CHConfig.Core.Notifications.Sounds.Enable"), false)); EXPECT_EQ(30000, m_cfg.GetInt(_T("CHConfig.Core.AutosaveInterval"), 0)); - EXPECT_EQ(TString(_T("\\media\\ding.wav")), m_cfg.GetString(_T("CHConfig.Core.Notifications.Sounds.FinishedSoundPath"), _T(""))); + EXPECT_EQ(TString(_T("\\\x597D\x8FD0\\ding.wav")), m_cfg.GetString(_T("CHConfig.Core.Notifications.Sounds.FinishedSoundPath"), _T(""))); } TEST(TConfigTests, WriteToString) @@ -583,7 +585,7 @@ FirstName<WINDOWS>\\FirstPathSecondName<WINDOWS>\\SecondPath\ c:\\Windows\\System32d:\\Moviesx:\\Musics:\\projects\\ch-rw\ true<WINDOWS>\\media\\chord.wav\ -<WINDOWS>\\media\\ding.wav")), wstrWithDeletion); +<WINDOWS>\\\x597D\x8FD0\\ding.wav")), wstrWithDeletion); } /////////////////////////////////////////////////////////////////////////// @@ -607,7 +609,7 @@ m_cfg.ExtractSubConfig(_T("CHConfig.Core.Notifications.Sounds"), cfgSub); EXPECT_EQ(true, cfgSub.GetBool(_T("Enable"))); EXPECT_EQ(TString(_T("\\media\\chord.wav")), cfgSub.GetString(_T("ErrorSoundPath"))); - EXPECT_EQ(TString(_T("\\media\\ding.wav")), cfgSub.GetString(_T("FinishedSoundPath"))); + EXPECT_EQ(TString(_T("\\\x597D\x8FD0\\ding.wav")), cfgSub.GetString(_T("FinishedSoundPath"))); } TEST_F(InitializedConfigFixture, ExtractMultipleConfigs)