Add debug output for message loading and create test for single message verification

This commit is contained in:
scawful
2024-11-08 00:18:58 -05:00
parent 3d23922f71
commit e1a9d40c4b
2 changed files with 22 additions and 1 deletions

View File

@@ -87,6 +87,10 @@ absl::Status MessageEditor::Initialize() {
*font_gfx_bitmap_.mutable_palette() = color_palette;
for (const auto& each_message : list_of_texts_) {
std::cout << "Message #" << each_message.ID << " at address "
<< core::UppercaseHexLong(each_message.Address) << std::endl;
std::cout << " " << each_message.RawString << std::endl;
// Each string has a [:XX] char encoded
// The corresponding character is found in CharEncoder unordered_map
std::string parsed_message = "";
@@ -115,6 +119,7 @@ absl::Status MessageEditor::Initialize() {
}
}
}
std::cout << " > " << parsed_message << std::endl;
parsed_messages_.push_back(parsed_message);
}

View File

@@ -26,7 +26,23 @@ TEST_F(MessageTest, LoadMessagesFromRomOk) {
EXPECT_OK(message_editor_.Initialize());
}
TEST_F(MessageTest, FindMatchingCharacterOk) {}
/**
* @test Verify that a single message can be loaded from the ROM.
*
* @details The message is loaded from the ROM and the message is parsed.
*
* Message #1 at address 0x0E000B
RawString:
[S:00][3][][:75][:44][CH2I]
Parsed:
[S:##]A
[3]give
[2]give >[CH2I]
*/
TEST_F(MessageTest, VerifySingleMessageFromRomOk) {
// TODO - Implement this test
}
} // namespace zelda3
} // namespace test