-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for message window widgets
Signed-off-by: Norbert Takacs <norbert.takacs@commsignia.net>
- Loading branch information
Norbert Takacs
committed
Aug 10, 2023
1 parent
9813450
commit c4a7910
Showing
4 changed files
with
225 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2023 Norbert Takacs | ||
* | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
*/ | ||
|
||
#include <filesystem> | ||
#include "XPLMDefs.h" | ||
#include "XPLMGraphics.h" | ||
#include "XPLMPlugin.h" | ||
#include "XPLMDisplay.h" | ||
#include "XPWidgetDefs.h" | ||
|
||
#include "CppUnitTest.h" | ||
#include "core/ConfigParser.h" | ||
#include "log-message-window/MessageWindow.h" | ||
|
||
int test_invoke_widget_callback(XPWidgetMessage message, XPWidgetID widget_id, intptr_t param1, intptr_t param2); | ||
|
||
using namespace Microsoft::VisualStudio::CppUnitTestFramework; | ||
|
||
namespace test | ||
{ | ||
TEST_CLASS(TestLogWindow) | ||
{ | ||
private: | ||
|
||
public: | ||
TEST_METHOD_INITIALIZE(TestLogWindowInit) | ||
{ | ||
|
||
} | ||
|
||
TEST_METHOD(TestLogWindowCallback) | ||
{ | ||
MessageWindow message_window("test window"); | ||
message_window.append_line(std::string("test message 1")); | ||
message_window.append_line(std::string("test message 2")); | ||
message_window.show(); | ||
|
||
Assert::AreEqual(1, test_invoke_widget_callback(xpMsg_Draw, NULL, 0, 0), L"invoke all callback functions: failed", 0); | ||
} | ||
|
||
TEST_METHOD_CLEANUP(TestLogWindowCleanup) | ||
{ | ||
|
||
} | ||
}; | ||
} |