From d4d6c6c8b6ca52e702f2043c2558770f66fb7ff9 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 7 Jun 2019 02:24:28 -0400 Subject: [PATCH] add tests --- CMakeLists.txt | 1 + testractor/CMakeLists.txt | 1 + testractor/resource.h | 27 ++++++++++++++++++++++ testractor/testractor.cpp | 46 ++++++++++++++++++++++++++++++++++++++ testractor/testractor.rc | Bin 0 -> 5894 bytes 5 files changed, 75 insertions(+) create mode 100644 testractor/CMakeLists.txt create mode 100644 testractor/resource.h create mode 100644 testractor/testractor.cpp create mode 100644 testractor/testractor.rc diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f6c8ca..268576e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,3 +34,4 @@ add_subdirectory(GUI) add_subdirectory(GUI/host) add_subdirectory(texthook) add_subdirectory(extensions) +add_subdirectory(testractor) diff --git a/testractor/CMakeLists.txt b/testractor/CMakeLists.txt new file mode 100644 index 0000000..7bca354 --- /dev/null +++ b/testractor/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(Testractor WIN32 testractor.cpp testractor.rc) diff --git a/testractor/resource.h b/testractor/resource.h new file mode 100644 index 0000000..707fe42 --- /dev/null +++ b/testractor/resource.h @@ -0,0 +1,27 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by testractor.rc +// +#define IDD_DIALOG1 101 +#define IDC_EDIT1 1000 +#define IDC_EDIT2 1001 +#define IDC_EDIT3 1002 +#define IDC_EDIT4 1003 +#define IDC_EDIT5 1004 +#define IDC_EDIT6 1005 +#define IDC_EDIT7 1006 +#define IDC_EDIT8 1007 +#define IDC_EDIT9 1008 +#define IDC_EDIT10 1009 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1011 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/testractor/testractor.cpp b/testractor/testractor.cpp new file mode 100644 index 0000000..29d17a9 --- /dev/null +++ b/testractor/testractor.cpp @@ -0,0 +1,46 @@ +#include "common.h" +#include "resource.h" + +wchar_t buffer[1000] = {}; +std::array vars = {}; + +int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int) +{ + ShowWindow(CreateDialogParamW(hInstance, MAKEINTRESOURCEW(IDD_DIALOG1), NULL, [](HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -> INT_PTR + { + switch (uMsg) + { + case WM_CLOSE: + { + DestroyWindow(hWnd); + } + return TRUE; + case WM_DESTROY: + { + PostQuitMessage(0); + } + return TRUE; + case WM_COMMAND: + { + if (HIWORD(wParam) == EN_CHANGE) + { + GetWindowTextW((HWND)lParam, buffer, std::size(buffer)); + try { vars.at(LOWORD(wParam) - IDC_EDIT1) = std::stoi(buffer); } + catch (std::invalid_argument&) {} + } + } + break; + } + return FALSE; + }, 0), SW_SHOW); + + std::thread([] { while (true) lstrlenW(L"こんにちは"); }).detach(); + + MSG msg; + while (GetMessageW(&msg, NULL, 0, 0) > 0) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + return 0; +} diff --git a/testractor/testractor.rc b/testractor/testractor.rc new file mode 100644 index 0000000000000000000000000000000000000000..611d32dedf49adb39c2a7ad5815cd86fa15722b9 GIT binary patch literal 5894 zcmd^DT~8W86ur+)`X9FVqN!1rMLv?I39_(~A`n2Ui3w>`l*D2Kn)ac;z3n-77#DEY zMNvZAY=+sLxpU9lPwvd`U)!=RjvPo|&SWSzGD7RgEyj*8Hj+E}BG>pT$$LDGT*`$E z(1sYlMSqU5A$qR6!`m6&9ej~nU%r86OWw*GploZuhS33LuR(pTw5bQ{x8zDvG1MRA zyK*p?r2Kf#pBSt6Sm_-pL-I>VPQ6}1OY3rok^a3N+juit9mz(7U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