From c34f823caec03e40d2d12bd91a1bb481dd73b343 Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Thu, 27 Jul 2023 13:45:18 +0900 Subject: [PATCH 1/6] Add gtest sample --- Sazabi.sln | 30 +++++++ test/SazabiSpec/SazabiSpec.vcxproj | 128 +++++++++++++++++++++++++++++ test/SazabiSpec/packages.config | 4 + test/SazabiSpec/pch.cpp | 5 ++ test/SazabiSpec/pch.h | 7 ++ test/SazabiSpec/test.cpp | 10 +++ 6 files changed, 184 insertions(+) create mode 100644 test/SazabiSpec/SazabiSpec.vcxproj create mode 100644 test/SazabiSpec/packages.config create mode 100644 test/SazabiSpec/pch.cpp create mode 100644 test/SazabiSpec/pch.h create mode 100644 test/SazabiSpec/test.cpp diff --git a/Sazabi.sln b/Sazabi.sln index efd684f..857045a 100644 --- a/Sazabi.sln +++ b/Sazabi.sln @@ -5,20 +5,50 @@ VisualStudioVersion = 16.0.31605.320 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sazabi", "Sazabi.vcxproj", "{83410426-0B15-352C-4BC5-CCD2A7EF1930}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SazabiSpec", "test\SazabiSpec\SazabiSpec.vcxproj", "{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution D64_CSG|Win32 = D64_CSG|Win32 D64_CSG|x64 = D64_CSG|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 R64_CSG|Win32 = R64_CSG|Win32 R64_CSG|x64 = R64_CSG|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|Win32.ActiveCfg = D64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|Win32.Build.0 = D64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|x64.ActiveCfg = D64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|Win32.ActiveCfg = D64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|Win32.Build.0 = D64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|x64.ActiveCfg = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|x64.Build.0 = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|Win32.ActiveCfg = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|Win32.Build.0 = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|x64.ActiveCfg = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|Win32.ActiveCfg = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|Win32.Build.0 = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.ActiveCfg = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.Build.0 = R64_CSG|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.ActiveCfg = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.Build.0 = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.ActiveCfg = Debug|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.Build.0 = Debug|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.ActiveCfg = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.Build.0 = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.ActiveCfg = Debug|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.Build.0 = Debug|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|Win32.ActiveCfg = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|Win32.Build.0 = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|x64.ActiveCfg = Release|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|x64.Build.0 = Release|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|Win32.ActiveCfg = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|Win32.Build.0 = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|x64.ActiveCfg = Release|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/test/SazabiSpec/SazabiSpec.vcxproj b/test/SazabiSpec/SazabiSpec.vcxproj new file mode 100644 index 0000000..afadc3c --- /dev/null +++ b/test/SazabiSpec/SazabiSpec.vcxproj @@ -0,0 +1,128 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {80871372-2d7e-43af-9ebb-b6a77ed3be21} + Win32Proj + 10.0.18362.0 + Application + v142 + Unicode + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + {83410426-0b15-352c-4bc5-ccd2a7ef1930} + + + + + + + + + + + + + Use + pch.h + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Level3 + + + true + Console + + + + + Use + pch.h + Disabled + X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Level3 + + + true + Console + + + + + Use + pch.h + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + ProgramDatabase + + + true + Console + true + true + + + + + Use + pch.h + X64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + ProgramDatabase + + + true + Console + true + true + + + + + このプロジェクトは、このコンピューター上にない NuGet パッケージを参照しています。それらのパッケージをダウンロードするには、[NuGet パッケージの復元] を使用します。詳細については、http://go.microsoft.com/fwlink/?LinkID=322105 を参照してください。見つからないファイルは {0} です。 + + + + \ No newline at end of file diff --git a/test/SazabiSpec/packages.config b/test/SazabiSpec/packages.config new file mode 100644 index 0000000..2d66f74 --- /dev/null +++ b/test/SazabiSpec/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/test/SazabiSpec/pch.cpp b/test/SazabiSpec/pch.cpp new file mode 100644 index 0000000..bc31a45 --- /dev/null +++ b/test/SazabiSpec/pch.cpp @@ -0,0 +1,5 @@ +// +// pch.cpp +// + +#include "pch.h" diff --git a/test/SazabiSpec/pch.h b/test/SazabiSpec/pch.h new file mode 100644 index 0000000..17f8dfa --- /dev/null +++ b/test/SazabiSpec/pch.h @@ -0,0 +1,7 @@ +// +// pch.h +// + +#pragma once + +#include "gtest/gtest.h" diff --git a/test/SazabiSpec/test.cpp b/test/SazabiSpec/test.cpp new file mode 100644 index 0000000..4530f33 --- /dev/null +++ b/test/SazabiSpec/test.cpp @@ -0,0 +1,10 @@ +#include "pch.h" +#include "..\..\StdAfx.h" +#include "..\..\Sazabi.h" +#include "..\..\client_handler.h" + +TEST(TestCaseName, TestName) { + EXPECT_EQ(1, 1); + ClientHandler handler; + EXPECT_TRUE(true); +} \ No newline at end of file From 4a1832e4d33e32192e83d1dd26089c822fa9281a Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Mon, 31 Jul 2023 11:01:51 +0900 Subject: [PATCH 2/6] Move the main function to Main.cpp from Sazabi.cpp Add dependency on .obj files Add a sample test --- Main.cpp | 104 +++++++++++++++++++++ Sazabi.cpp | 94 ------------------- Sazabi.rc | 2 +- Sazabi.sln | 8 +- Sazabi.vcxproj | 1 + Sazabi.vcxproj.filters | 3 + test/SazabiSpec/SazabiSpec.vcxproj | 21 ++++- test/SazabiSpec/SazabiSpec.vcxproj.filters | 20 ++++ test/SazabiSpec/test.cpp | 10 -- test/SazabiSpec/test_sbcommon.cpp | 14 +++ 10 files changed, 164 insertions(+), 113 deletions(-) create mode 100644 Main.cpp create mode 100644 test/SazabiSpec/SazabiSpec.vcxproj.filters delete mode 100644 test/SazabiSpec/test.cpp create mode 100644 test/SazabiSpec/test_sbcommon.cpp diff --git a/Main.cpp b/Main.cpp new file mode 100644 index 0000000..e1dca8d --- /dev/null +++ b/Main.cpp @@ -0,0 +1,104 @@ +#include "stdafx.h" +#include "Sazabi.h" + +#include "MainFrm.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +int MY_WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) +{ + int nReturnCode = -1; + CWinThread* pThread = AfxGetThread(); + CWinApp* pApp = AfxGetApp(); + if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow)) + { + AfxWinTerm(); + return -1; + } + + if (pApp != NULL) + { + if (!pApp->InitApplication()) + { + AfxWinTerm(); + return -1; + } + } + + if (!pThread->InitInstance()) + { + if (pThread->m_pMainWnd) + { + pThread->m_pMainWnd->DestroyWindow(); + } + nReturnCode = pThread->ExitInstance(); + AfxWinTerm(); + return nReturnCode; + } + + nReturnCode = pThread->Run(); + AfxWinTerm(); + return nReturnCode; +} + + +int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) +{ + +#ifdef _DEBUG + ::_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF); +#endif + HMODULE kernel32 = GetModuleHandleA("KERNEL32"); + if (kernel32) + { + typedef BOOL(WINAPI * Proc_pfnSetDllDirectoryW)(LPCWSTR); + Proc_pfnSetDllDirectoryW pfnSetDllDirectoryW = (Proc_pfnSetDllDirectoryW)GetProcAddress(kernel32, "SetDllDirectoryW"); + if (pfnSetDllDirectoryW) + { + pfnSetDllDirectoryW(L""); + } + typedef BOOL(WINAPI * Proc_pfnSetSearchPathMode)(DWORD); + Proc_pfnSetSearchPathMode pfnSetSearchPathMode = (Proc_pfnSetSearchPathMode)GetProcAddress(kernel32, "SetSearchPathMode"); + if (pfnSetSearchPathMode) + { + const DWORD dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE = 1; + const DWORD dwBASE_SEARCH_PATH_PERMANENT = 0x8000; + pfnSetSearchPathMode(dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | dwBASE_SEARCH_PATH_PERMANENT); + } + } + setlocale(LC_ALL, "Japanese"); + + int nRet = 0; + CString strCommandLineData; + strCommandLineData = ::GetCommandLine(); + if (strCommandLineData.Find(_T("--type=")) > 0) + { +#if CHROME_VERSION_MAJOR < 112 + CefEnableHighDPISupport(); +#endif + CefMainArgs mainargs(hInstance); + void* sandbox_info = NULL; + if (strCommandLineData.Find(_T("--type=renderer")) > 0) + { + CefRefPtr app; + app = new AppRenderer(); + int exitCode = CefExecuteProcess(mainargs, app.get(), sandbox_info); + if (exitCode >= 0) + { + return exitCode; + } + } + int exit_code = CefExecuteProcess(mainargs, nullptr, sandbox_info); + if (exit_code >= 0) + { + return exit_code; + } + } + nRet = MY_WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow); + return nRet; +} +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Sazabi.cpp b/Sazabi.cpp index b39ba50..bc00842 100644 --- a/Sazabi.cpp +++ b/Sazabi.cpp @@ -5065,97 +5065,3 @@ void CAboutDlg::OnBnClickedCefVersion() ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -int MY_WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ - int nReturnCode = -1; - CWinThread* pThread = AfxGetThread(); - CWinApp* pApp = AfxGetApp(); - if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow)) - { - AfxWinTerm(); - return -1; - } - - if (pApp != NULL) - { - if (!pApp->InitApplication()) - { - AfxWinTerm(); - return -1; - } - } - - if (!pThread->InitInstance()) - { - if (pThread->m_pMainWnd) - { - pThread->m_pMainWnd->DestroyWindow(); - } - nReturnCode = pThread->ExitInstance(); - AfxWinTerm(); - return nReturnCode; - } - - nReturnCode = pThread->Run(); - AfxWinTerm(); - return nReturnCode; -} - -int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ - -#ifdef _DEBUG - ::_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF); -#endif - HMODULE kernel32 = GetModuleHandleA("KERNEL32"); - if (kernel32) - { - typedef BOOL(WINAPI * Proc_pfnSetDllDirectoryW)(LPCWSTR); - Proc_pfnSetDllDirectoryW pfnSetDllDirectoryW = (Proc_pfnSetDllDirectoryW)GetProcAddress(kernel32, "SetDllDirectoryW"); - if (pfnSetDllDirectoryW) - { - pfnSetDllDirectoryW(L""); - } - typedef BOOL(WINAPI * Proc_pfnSetSearchPathMode)(DWORD); - Proc_pfnSetSearchPathMode pfnSetSearchPathMode = (Proc_pfnSetSearchPathMode)GetProcAddress(kernel32, "SetSearchPathMode"); - if (pfnSetSearchPathMode) - { - const DWORD dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE = 1; - const DWORD dwBASE_SEARCH_PATH_PERMANENT = 0x8000; - pfnSetSearchPathMode(dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | dwBASE_SEARCH_PATH_PERMANENT); - } - } - setlocale(LC_ALL, "Japanese"); - - int nRet = 0; - CString strCommandLineData; - strCommandLineData = ::GetCommandLine(); - if (strCommandLineData.Find(_T("--type=")) > 0) - { -#if CHROME_VERSION_MAJOR < 112 - CefEnableHighDPISupport(); -#endif - CefMainArgs mainargs(hInstance); - void* sandbox_info = NULL; - if (strCommandLineData.Find(_T("--type=renderer")) > 0) - { - CefRefPtr app; - app = new AppRenderer(); - int exitCode = CefExecuteProcess(mainargs, app.get(), sandbox_info); - if (exitCode >= 0) - { - return exitCode; - } - } - int exit_code = CefExecuteProcess(mainargs, nullptr, sandbox_info); - if (exit_code >= 0) - { - return exit_code; - } - } - nRet = MY_WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow); - return nRet; -} -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Sazabi.rc b/Sazabi.rc index b5a98c0..30bb3a4 100644 --- a/Sazabi.rc +++ b/Sazabi.rc @@ -2322,7 +2322,7 @@ BEGIN IDS_STRING_CEF_LOCALE "en" IDS_STRING_CEF_ACCEPT_LANGUAGE_LIST "en-US" IDS_STRING_PROPRIETARY_CODEC_LICENSES - "\n\nAVC\nTHIS PRODUCT IS LICENSED UNDER THE\nAVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A\nCONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE\nREMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE\nAVC STANDARD (AVC VIDEO) AND/OR (ii) DECODE AVC VIDEO\nTHAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL\nACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER\nLICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR\nSHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL\nINFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE\nHTTP://WWW.MPEGLA.COM" + "\n\nAVC\nTHIS PRODUCT IS LICENSED UNDER THE\nAVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A\nCONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE\nREMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE\nAVC STANDARD (AVC VIDEOE AND/OR (ii) DECODE AVC VIDEO\nTHAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL\nACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER\nLICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR\nSHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL\nINFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE\nHTTP://WWW.MPEGLA.COM" END STRINGTABLE diff --git a/Sazabi.sln b/Sazabi.sln index 857045a..49ed98d 100644 --- a/Sazabi.sln +++ b/Sazabi.sln @@ -33,14 +33,14 @@ Global {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|Win32.Build.0 = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.ActiveCfg = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.Build.0 = R64_CSG|Win32 - {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.ActiveCfg = Debug|Win32 - {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.Build.0 = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.ActiveCfg = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.Build.0 = Release|Win32 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.ActiveCfg = Debug|x64 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.Build.0 = Debug|x64 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.ActiveCfg = Debug|Win32 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.Build.0 = Debug|Win32 - {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.ActiveCfg = Debug|x64 - {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.Build.0 = Debug|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.ActiveCfg = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.Build.0 = Release|Win32 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|Win32.ActiveCfg = Release|Win32 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|Win32.Build.0 = Release|Win32 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|x64.ActiveCfg = Release|x64 diff --git a/Sazabi.vcxproj b/Sazabi.vcxproj index 482f3f8..acc6ad8 100644 --- a/Sazabi.vcxproj +++ b/Sazabi.vcxproj @@ -188,6 +188,7 @@ + diff --git a/Sazabi.vcxproj.filters b/Sazabi.vcxproj.filters index 93eb447..6d816b6 100644 --- a/Sazabi.vcxproj.filters +++ b/Sazabi.vcxproj.filters @@ -56,6 +56,9 @@ DLG + + SB + diff --git a/test/SazabiSpec/SazabiSpec.vcxproj b/test/SazabiSpec/SazabiSpec.vcxproj index afadc3c..041dd90 100644 --- a/test/SazabiSpec/SazabiSpec.vcxproj +++ b/test/SazabiSpec/SazabiSpec.vcxproj @@ -36,22 +36,22 @@ - Create Create Create Create + + + + {83410426-0b15-352c-4bc5-ccd2a7ef1930} - - - @@ -70,7 +70,14 @@ true Console + C:\gitdir\Chronos\ChronosDebug\*.obj;%(AdditionalDependencies) + + move $(SolutionDir)ChronosDebug\Main.obj $(SolutionDir)ChronosDebug\Main.obj.backup + + + move $(SolutionDir)ChronosDebug\Main.obj.backup $(SolutionDir)ChronosDebug\Main.obj + @@ -102,6 +109,12 @@ true true + + move $(SolutionDir)ChronosRelease\Main.obj $(SolutionDir)ChronosRelease\Main.obj.backup + + + move $(SolutionDir)ChronosRelease\Main.obj.backup $(SolutionDir)ChronosRelease\Main.obj + diff --git a/test/SazabiSpec/SazabiSpec.vcxproj.filters b/test/SazabiSpec/SazabiSpec.vcxproj.filters new file mode 100644 index 0000000..b3891a6 --- /dev/null +++ b/test/SazabiSpec/SazabiSpec.vcxproj.filters @@ -0,0 +1,20 @@ + + + + + + SB + + + + + + + + + + + {c5c91dca-edee-4831-ad5d-3dc17466180b} + + + \ No newline at end of file diff --git a/test/SazabiSpec/test.cpp b/test/SazabiSpec/test.cpp deleted file mode 100644 index 4530f33..0000000 --- a/test/SazabiSpec/test.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "pch.h" -#include "..\..\StdAfx.h" -#include "..\..\Sazabi.h" -#include "..\..\client_handler.h" - -TEST(TestCaseName, TestName) { - EXPECT_EQ(1, 1); - ClientHandler handler; - EXPECT_TRUE(true); -} \ No newline at end of file diff --git a/test/SazabiSpec/test_sbcommon.cpp b/test/SazabiSpec/test_sbcommon.cpp new file mode 100644 index 0000000..8c213a9 --- /dev/null +++ b/test/SazabiSpec/test_sbcommon.cpp @@ -0,0 +1,14 @@ +#include "pch.h" +#include "..\..\StdAfx.h" +#include "..\..\sbcommon.h" + +TEST(Test_Sbcommon, CLogDispatcher_GetOpStr) +{ + CLogDispatcher clogDispatcher; + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_UPLOAD), _T("upload")); + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_DOWNLOAD), _T("download")); + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_BROWSING), _T("browsing")); + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_M_GET), _T("upload")); + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_M_POST), _T("download")); + EXPECT_EQ(clogDispatcher.GetOpStr(-1), _T("download")); +} \ No newline at end of file From 9568aaa5f356cee2d8a49bc88fe914686aaa980f Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Mon, 31 Jul 2023 13:14:34 +0900 Subject: [PATCH 3/6] Add a build event to copy lib/rlib --- test/SazabiSpec/SazabiSpec.vcxproj | 7 +++++-- test/SazabiSpec/test_sbcommon.cpp | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/SazabiSpec/SazabiSpec.vcxproj b/test/SazabiSpec/SazabiSpec.vcxproj index 041dd90..39fe69b 100644 --- a/test/SazabiSpec/SazabiSpec.vcxproj +++ b/test/SazabiSpec/SazabiSpec.vcxproj @@ -73,7 +73,9 @@ C:\gitdir\Chronos\ChronosDebug\*.obj;%(AdditionalDependencies) - move $(SolutionDir)ChronosDebug\Main.obj $(SolutionDir)ChronosDebug\Main.obj.backup + xcopy /Y $(SolutionDir)lib $(ProjectDir)lib\ +move $(SolutionDir)ChronosDebug\Main.obj $(SolutionDir)ChronosDebug\Main.obj.backup + move $(SolutionDir)ChronosDebug\Main.obj.backup $(SolutionDir)ChronosDebug\Main.obj @@ -110,7 +112,8 @@ true - move $(SolutionDir)ChronosRelease\Main.obj $(SolutionDir)ChronosRelease\Main.obj.backup + xcopy /Y $(SolutionDir)rlib $(ProjectDir)rlib\ +move $(SolutionDir)ChronosRelease\Main.obj $(SolutionDir)ChronosRelease\Main.obj.backup move $(SolutionDir)ChronosRelease\Main.obj.backup $(SolutionDir)ChronosRelease\Main.obj diff --git a/test/SazabiSpec/test_sbcommon.cpp b/test/SazabiSpec/test_sbcommon.cpp index 8c213a9..1383435 100644 --- a/test/SazabiSpec/test_sbcommon.cpp +++ b/test/SazabiSpec/test_sbcommon.cpp @@ -1,7 +1,6 @@ #include "pch.h" #include "..\..\StdAfx.h" #include "..\..\sbcommon.h" - TEST(Test_Sbcommon, CLogDispatcher_GetOpStr) { CLogDispatcher clogDispatcher; From 9876d45d5097beb8aebfff166d4cca521d2c6c3c Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Fri, 16 Feb 2024 17:33:48 +0900 Subject: [PATCH 4/6] fix to pass build --- test/SazabiSpec/test_sbcommon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/SazabiSpec/test_sbcommon.cpp b/test/SazabiSpec/test_sbcommon.cpp index 1383435..0ed380a 100644 --- a/test/SazabiSpec/test_sbcommon.cpp +++ b/test/SazabiSpec/test_sbcommon.cpp @@ -1,6 +1,12 @@ #include "pch.h" #include "..\..\StdAfx.h" #include "..\..\sbcommon.h" +#include "gtest/gtest.h" + +class Test_Sbcommon : public ::testing::Test +{ +}; + TEST(Test_Sbcommon, CLogDispatcher_GetOpStr) { CLogDispatcher clogDispatcher; From c5876b6bd7889f38bcd2b47f54c47e5fef328007 Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Mon, 19 Feb 2024 10:12:22 +0900 Subject: [PATCH 5/6] fix to path build --- Sazabi.sln | 4 ++-- test/SazabiSpec/SazabiSpec.vcxproj | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Sazabi.sln b/Sazabi.sln index 49ed98d..aef9ed6 100644 --- a/Sazabi.sln +++ b/Sazabi.sln @@ -33,8 +33,8 @@ Global {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|Win32.Build.0 = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.ActiveCfg = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.Build.0 = R64_CSG|Win32 - {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.ActiveCfg = Release|Win32 - {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.Build.0 = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.ActiveCfg = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.Build.0 = Debug|Win32 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.ActiveCfg = Debug|x64 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.Build.0 = Debug|x64 {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.ActiveCfg = Debug|Win32 diff --git a/test/SazabiSpec/SazabiSpec.vcxproj b/test/SazabiSpec/SazabiSpec.vcxproj index 39fe69b..ee92938 100644 --- a/test/SazabiSpec/SazabiSpec.vcxproj +++ b/test/SazabiSpec/SazabiSpec.vcxproj @@ -74,12 +74,15 @@ xcopy /Y $(SolutionDir)lib $(ProjectDir)lib\ -move $(SolutionDir)ChronosDebug\Main.obj $(SolutionDir)ChronosDebug\Main.obj.backup + move $(SolutionDir)ChronosDebug\Main.obj.backup $(SolutionDir)ChronosDebug\Main.obj + + move $(SolutionDir)ChronosDebug\Main.obj $(SolutionDir)ChronosDebug\Main.obj.backup + @@ -110,14 +113,17 @@ move $(SolutionDir)ChronosDebug\Main.obj $(SolutionDir)ChronosDebug\Main.obj.bac Console true true + C:\gitdir\Chronos\ChronosRelease\*.obj;$(MSBuildThisFileDirectory)..\..\lib\native\v140\windesktop\msvcstl\static\rt-static\x86\Release\gtest_main.lib;%(AdditionalDependencies) - xcopy /Y $(SolutionDir)rlib $(ProjectDir)rlib\ -move $(SolutionDir)ChronosRelease\Main.obj $(SolutionDir)ChronosRelease\Main.obj.backup + xcopy /Y $(SolutionDir)rlib $(ProjectDir)rlib\ move $(SolutionDir)ChronosRelease\Main.obj.backup $(SolutionDir)ChronosRelease\Main.obj + + move $(SolutionDir)ChronosRelease\Main.obj $(SolutionDir)ChronosRelease\Main.obj.backup + From e7d7de0a7c6e643803e6a1b64278b8c623574236 Mon Sep 17 00:00:00 2001 From: Takashi Hashida Date: Mon, 19 Feb 2024 10:34:45 +0900 Subject: [PATCH 6/6] Remove needless liens --- test/SazabiSpec/SazabiSpec.vcxproj | 4 ++-- test/SazabiSpec/test_sbcommon.cpp | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/test/SazabiSpec/SazabiSpec.vcxproj b/test/SazabiSpec/SazabiSpec.vcxproj index ee92938..8806288 100644 --- a/test/SazabiSpec/SazabiSpec.vcxproj +++ b/test/SazabiSpec/SazabiSpec.vcxproj @@ -21,8 +21,8 @@ {80871372-2d7e-43af-9ebb-b6a77ed3be21} Win32Proj - 10.0.18362.0 - Application + 10.0.22000.0 + DynamicLibrary v142 Unicode diff --git a/test/SazabiSpec/test_sbcommon.cpp b/test/SazabiSpec/test_sbcommon.cpp index 0ed380a..8c213a9 100644 --- a/test/SazabiSpec/test_sbcommon.cpp +++ b/test/SazabiSpec/test_sbcommon.cpp @@ -1,11 +1,6 @@ #include "pch.h" #include "..\..\StdAfx.h" #include "..\..\sbcommon.h" -#include "gtest/gtest.h" - -class Test_Sbcommon : public ::testing::Test -{ -}; TEST(Test_Sbcommon, CLogDispatcher_GetOpStr) {