Lines Matching full:data
18 std::string data;
21 SessionCommand* CreateCommandFromData(const TestData& data) {
24 data.command_id,
25 static_cast<SessionCommand::size_type>(data.data.size()));
26 if (!data.data.empty())
27 memcpy(command->contents(), data.data.c_str(), data.data.size());
41 void AssertCommandEqualsData(const TestData& data, SessionCommand* command) {
42 EXPECT_EQ(data.command_id, command->id());
43 EXPECT_EQ(data.data.size(), command->size());
45 memcmp(command->contents(), data.data.c_str(), command->size()) == 0);
56 struct TestData data = { 1, "a" };
58 commands.push_back(CreateCommandFromData(data));
68 AssertCommandEqualsData(data, commands[0]);
85 struct TestData data[] = {
101 for (size_t i = 0; i < arraysize(data); ++i) {
106 // Read previous data.
111 AssertCommandEqualsData(data[j - commands.begin()], *j);
116 commands.push_back(CreateCommandFromData(data[i]));
122 struct TestData data[] = {
130 commands.push_back(CreateCommandFromData(data[0]));
138 commands.push_back(CreateCommandFromData(data[1]));
147 AssertCommandEqualsData(data[0], commands[0]);
148 AssertCommandEqualsData(data[1], commands[2]);
198 // And make sure we get back the expected data.