Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 75da226

Browse files
committed
Replace std::vector<uint8_t>with std::string
1 parent 4f6dead commit 75da226

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

shell/platform/windows/text_input_plugin_unittest.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,13 @@ TEST(TextInputPluginTest, VerifyComposingSendStateUpdate) {
208208
}
209209

210210
TEST(TextInputPluginTest, VerifyInputActionNewlineInsertNewLine) {
211-
std::vector<std::vector<uint8_t>> messages;
211+
// Store messages as std::string for convenience.
212+
std::vector<std::string> messages;
212213

213214
TestBinaryMessenger messenger(
214215
[&messages](const std::string& channel, const uint8_t* message,
215216
size_t message_size, BinaryReply reply) {
216-
int length = static_cast<int>(message_size);
217-
std::vector<uint8_t> last_message(length);
218-
memcpy(&last_message[0], &message[0], length * sizeof(uint8_t));
217+
std::string last_message(reinterpret_cast<const char*>(message), message_size);
219218
messages.push_back(last_message);
220219
});
221220
BinaryReply reply_handler = [](const uint8_t* reply, size_t reply_size) {};

0 commit comments

Comments
 (0)