add message_editor_test and register in ctx
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/testable.h"
|
||||
#include "app/editor/message/message_data.h"
|
||||
#include "app/editor/utils/editor.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
@@ -44,7 +45,6 @@ static int defaultColor = 6;
|
||||
|
||||
static std::vector<uint8_t> ParseMessageToData(string str);
|
||||
|
||||
|
||||
struct TextElement {
|
||||
uint8_t ID;
|
||||
string Token;
|
||||
@@ -242,7 +242,9 @@ static const std::unordered_map<uint8_t, wchar_t> CharEncoder = {
|
||||
static TextElement DictionaryElement =
|
||||
TextElement(0x80, DICTIONARYTOKEN, true, "Dictionary");
|
||||
|
||||
class MessageEditor : public Editor, public SharedRom {
|
||||
class MessageEditor : public Editor,
|
||||
public SharedRom,
|
||||
public core::GuiTestable {
|
||||
public:
|
||||
struct DictionaryEntry {
|
||||
uint8_t ID;
|
||||
@@ -295,6 +297,7 @@ class MessageEditor : public Editor, public SharedRom {
|
||||
return absl::UnimplementedError("Find not implemented");
|
||||
}
|
||||
absl::Status Save();
|
||||
void RegisterTests(ImGuiTestEngine* e) override;
|
||||
|
||||
TextElement FindMatchingCommand(uint8_t byte);
|
||||
TextElement FindMatchingSpecial(uint8_t value);
|
||||
|
||||
21
src/app/editor/message/message_editor_test.cc
Normal file
21
src/app/editor/message/message_editor_test.cc
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "message_editor.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace editor {
|
||||
|
||||
void MessageEditor::RegisterTests(ImGuiTestEngine* e) {
|
||||
test_engine = e;
|
||||
ImGuiTest* t = nullptr;
|
||||
|
||||
t = IM_REGISTER_TEST(e, "message_editor", "read_all_text_data");
|
||||
t->TestFunc = [](ImGuiTestContext* ctx) {
|
||||
ctx->SetRef("##YazeMain/##TabBar/Message");
|
||||
ctx->ItemClick("TestButton");
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace editor
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
Reference in New Issue
Block a user