Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions build-gnu.bat
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ if errorlevel 1 (
popd
exit /b 1
)
mingw32-make -f "%~dp0tests\unittests\resources\en-US\Makefile" -C "%~dp0tests\unittests\resources\en-US" OUTDIR="%TESTS1_BUILD_DIR%"
if errorlevel 1 (
echo error 2 errorlevel %errorlevel%
popd
exit /b 1
)
mingw32-make -f "%TESTS1_MAKEFILE%" MYDEFINES="%MYDEFINES%" SAKURA_CORE=../sakura_core OUTDIR=%OUTDIR% -j4
if errorlevel 1 (
echo error 2 errorlevel %errorlevel%
Expand Down
9 changes: 5 additions & 4 deletions sakura_core/macro/CPPA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ char* CPPA::GetDeclarations( const MacroFuncInfo& cMacroFuncInfo, char* szBuffer
strcpy( szArguments[i], "u0: Unknown" );
}
}
std::filesystem::path funcName(cMacroFuncInfo.m_pszFuncName);
if ( i > 0 ){ // 引数があったとき
int j;
char szArgument[8*20];
Expand All @@ -256,18 +257,18 @@ char* CPPA::GetDeclarations( const MacroFuncInfo& cMacroFuncInfo, char* szBuffer
strcat( szArgument, "; " );
strcat( szArgument, szArguments[j] );
}
auto_sprintf( szBuffer, "%hs S_%ls(%hs)%hs; index %d;",
auto_sprintf( szBuffer, "%hs S_%hs(%hs)%hs; index %d;",
szType,
cMacroFuncInfo.m_pszFuncName,
funcName.string().c_str(),
szArgument,
szReturn,
cMacroFuncInfo.m_nFuncID
);
}
else {
auto_sprintf( szBuffer, "%hs S_%ls%hs; index %d;",
auto_sprintf( szBuffer, "%hs S_%hs%hs; index %d;",
szType,
cMacroFuncInfo.m_pszFuncName,
funcName.string().c_str(),
szReturn,
cMacroFuncInfo.m_nFuncID
);
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ $(exe): $(OBJS) $(SAKURA_OBJS)

$(OBJS):

tests1_rc.o: tests1_rc.rc.utf8 $(sakura_rc) resources.ja-JP.zip resources.en-US.zip
tests1_rc.o: tests1_rc.rc.utf8 $(sakura_rc) resources.ja-JP.zip
$(RC) -c utf-8 -I. -I$(SRCDIR) $(DEFINES) $< -o $@

tests1_rc.rc.utf8: tests1_rc.rc
Expand Down
27 changes: 13 additions & 14 deletions tests/unittests/code-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@
*/
#include "pch.h"

#ifndef NOMINMAX
#define NOMINMAX
#endif /* #ifndef NOMINMAX */

#include <tchar.h>
#include <Windows.h>

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <regex>
#include <string>
#include <string_view>

#include "basis/primitive.h"
#include "util/string_ex.h"
#include "StartEditorProcessForTest.h"
Expand Down Expand Up @@ -85,9 +71,22 @@ static void InvokeWinMainIfNeeded(std::wstring_view commandLine)
* テストモジュールのエントリポイント
*/
int wmain(int argc, wchar_t **argv) {

// テスト実行時のロケールは日本語に固定する
const auto langId = MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT);
const auto lcid = MAKELCID(langId, SORT_DEFAULT);
SetThreadUILanguage(lcid); // スレッドのUI言語を変更

// コマンドラインに -PROF 指定がある場合、wWinMainを起動して終了する。
InvokeWinMainIfNeeded(::GetCommandLineW());

// LCIDからロケール名を取得("ja-JP"が取れる)
StaticString<LOCALE_NAME_MAX_LENGTH> szLocaleName;
LCIDToLocaleName(lcid, szLocaleName, szLocaleName.Length(), NULL);

// Cロケールも変更
_wsetlocale(LC_ALL, szLocaleName);

// WinMainを起動しない場合、標準のgmock_main同様の処理を実行する。
// InitGoogleMock は Google Test の初期化も行うため、InitGoogleTest を別に呼ぶ必要はない。
printf("Running main() from %s\n", __FILE__);
Expand Down
58 changes: 0 additions & 58 deletions tests/unittests/resources/en-US/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion tests/unittests/resources/en-US/test-plugin/plugin.def

This file was deleted.

2 changes: 0 additions & 2 deletions tests/unittests/test-cppa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ TEST(CPPA, GetDllNameImp)
*/
TEST(CPPA, GetDeclarations)
{
setlocale(LC_ALL, "Japanese");

CPPA cPpa;

// バッファ
Expand Down
4 changes: 0 additions & 4 deletions tests/unittests/tests1.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,10 @@
<Target Name="MakeTestResource" BeforeTargets="ResourceCompile" Inputs="@(TestResource->'resources\ja-JP\%(RelativeDir)%(filename)%(Extension)')" Outputs="$(IntDir)resources.ja-JP.zip">
<Exec Command="7z u &quot;$(IntDir)resources.ja-JP.zip&quot; -tzip @(TestResource->'%(RelativeDir)%(filename)%(Extension)',' ')" WorkingDirectory="$(ProjectDir)resources\ja-JP" />
</Target>
<Target Name="MakeTestResourceEnUS" BeforeTargets="ResourceCompile" Inputs="@(TestResource->'resources\en-US\%(RelativeDir)%(filename)%(Extension)')" Outputs="$(IntDir)resources.en-US.zip">
<Exec Command="7z u &quot;$(IntDir)resources.en-US.zip&quot; -tzip @(TestResource->'%(RelativeDir)%(filename)%(Extension)',' ')" WorkingDirectory="$(ProjectDir)resources\en-US" />
</Target>
<Target Name="AppendCleanTargets" BeforeTargets="CoreClean">
<!-- Add files to @Clean just before running CoreClean. -->
<ItemGroup>
<Clean Include="$(IntDir)resources.ja-JP.zip" />
<Clean Include="$(IntDir)resources.en-US.zip" />
</ItemGroup>
</Target>
</Project>
43 changes: 0 additions & 43 deletions tests/unittests/tests1_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -53,49 +53,6 @@ IDR_ZIPRES1 101 "resources.ja-JP.zip"
#endif // 日本語 (日本) resources
/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// 英語 (米国) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE
BEGIN
"tests1_rc.h\0"
END

2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// 101
//
IDR_ZIPRES1 101 "resources.en-US.zip"

#endif // 英語 (米国) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
Expand Down