Lines Matching refs:EXPECT_EQ
28 EXPECT_EQ(MOJO_RESULT_OK,
44 EXPECT_EQ(MOJO_RESULT_OK,
58 EXPECT_EQ(MOJO_RESULT_OK,
72 EXPECT_EQ(MOJO_RESULT_OK,
87 EXPECT_EQ(MOJO_RESULT_OK,
103 EXPECT_EQ(MOJO_RESULT_OK,
113 EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT,
118 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
119 EXPECT_EQ(0u, num_bytes);
123 EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT,
128 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
135 EXPECT_EQ(MOJO_RESULT_OK,
138 EXPECT_EQ(2u * sizeof(elements[0]), num_bytes);
142 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
143 EXPECT_EQ(2 * sizeof(elements[0]), num_bytes);
149 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(elements, &num_bytes, false));
150 EXPECT_EQ(1u * sizeof(elements[0]), num_bytes);
151 EXPECT_EQ(123, elements[0]);
152 EXPECT_EQ(-1, elements[1]);
156 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
157 EXPECT_EQ(1 * sizeof(elements[0]), num_bytes);
163 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
165 EXPECT_EQ(-1, elements[0]);
166 EXPECT_EQ(-1, elements[1]);
172 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(elements, &num_bytes, false));
173 EXPECT_EQ(456, elements[0]);
174 EXPECT_EQ(-1, elements[1]);
178 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
179 EXPECT_EQ(0u, num_bytes);
199 EXPECT_EQ(MOJO_RESULT_OK,
208 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
213 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
219 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(elements, &num_bytes, true));
220 EXPECT_EQ(static_cast<uint32_t>(2u * sizeof(elements[0])), num_bytes);
224 EXPECT_EQ(MOJO_RESULT_OK,
227 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, NULL));
232 EXPECT_EQ(MOJO_RESULT_OK,
239 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(elements, &num_bytes, true));
240 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(elements[0])), num_bytes);
241 EXPECT_EQ(123, elements[0]);
242 EXPECT_EQ(-1, elements[1]);
245 EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(1000, &context));
246 EXPECT_EQ(78u, context);
252 EXPECT_EQ(MOJO_RESULT_OK,
255 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(elements[0])), num_bytes);
258 EXPECT_EQ(MOJO_RESULT_OK,
264 EXPECT_EQ(MOJO_RESULT_OK,
270 EXPECT_EQ(MOJO_RESULT_OK,
276 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(elements[0])), num_bytes);
277 EXPECT_EQ(456, static_cast<const int32_t*>(read_buffer)[0]);
278 EXPECT_EQ(MOJO_RESULT_OK,
283 EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(1000, &context));
284 EXPECT_EQ(90u, context);
290 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(elements, &num_bytes, false));
291 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(elements[0])), num_bytes);
295 EXPECT_EQ(MOJO_RESULT_OK,
302 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, waiter.Wait(1000, &context));
303 EXPECT_EQ(12u, context);
317 EXPECT_EQ(MOJO_RESULT_OK,
327 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
332 EXPECT_EQ(MOJO_RESULT_OK,
334 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, NULL));
340 EXPECT_EQ(MOJO_RESULT_OK,
345 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
350 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerDiscardData(&num_bytes, true));
351 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(elements[0])), num_bytes);
355 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
362 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(elements, &num_bytes, true));
363 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(elements[0])), num_bytes);
364 EXPECT_EQ(456, elements[0]);
365 EXPECT_EQ(-1, elements[1]);
369 EXPECT_EQ(MOJO_RESULT_OK,
376 EXPECT_EQ(MOJO_RESULT_OK,
380 EXPECT_EQ(MOJO_RESULT_OK, waiter.Wait(1000, &context));
381 EXPECT_EQ(90u, context);
389 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
396 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(elements, &num_bytes, true));
397 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(elements[0])), num_bytes);
398 EXPECT_EQ(789, elements[0]);
399 EXPECT_EQ(-1, elements[1]);
403 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
421 EXPECT_EQ(MOJO_RESULT_OK,
428 EXPECT_EQ(MOJO_RESULT_OK,
434 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
441 EXPECT_EQ(MOJO_RESULT_OK,
444 EXPECT_EQ(static_cast<uint32_t>(2u * sizeof(elements[0])), num_bytes);
446 EXPECT_EQ(123, read_elements[0]);
447 EXPECT_EQ(MOJO_RESULT_OK,
453 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
460 EXPECT_EQ(MOJO_RESULT_OK,
463 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(elements[0])), num_bytes);
465 EXPECT_EQ(456, read_elements[0]);
466 EXPECT_EQ(MOJO_RESULT_OK,
472 EXPECT_EQ(MOJO_RESULT_OK,
479 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, waiter.Wait(1000, &context));
480 EXPECT_EQ(56u, context);
496 EXPECT_EQ(MOJO_RESULT_OK,
504 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
509 EXPECT_EQ(MOJO_RESULT_OK,
516 EXPECT_EQ(MOJO_RESULT_OK,
518 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, NULL));
523 EXPECT_EQ(MOJO_RESULT_OK,
525 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, NULL));
529 EXPECT_EQ(MOJO_RESULT_OK,
535 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
540 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
547 EXPECT_EQ(MOJO_RESULT_OK,
554 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
558 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerEndWriteData(0u));
563 EXPECT_EQ(MOJO_RESULT_OK,
566 EXPECT_EQ(static_cast<uint32_t>(1u * sizeof(int32_t)), num_bytes);
570 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
575 EXPECT_EQ(MOJO_RESULT_OK,
577 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, NULL));
581 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerEndReadData(0u));
585 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
601 EXPECT_EQ(MOJO_RESULT_OK,
609 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
614 EXPECT_EQ(MOJO_RESULT_OK,
616 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, NULL));
621 EXPECT_EQ(MOJO_RESULT_OK,
623 EXPECT_EQ(static_cast<uint32_t>(sizeof(int32_t)), num_bytes);
627 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
632 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
638 EXPECT_EQ(MOJO_RESULT_OK,
640 EXPECT_EQ(static_cast<uint32_t>(sizeof(int32_t)), num_bytes);
644 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
649 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
655 EXPECT_EQ(MOJO_RESULT_OK,
657 EXPECT_EQ(static_cast<uint32_t>(sizeof(int32_t)), num_bytes);
658 EXPECT_EQ(456, element);
662 EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS,
667 EXPECT_EQ(MOJO_RESULT_OK,
669 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, waiter.Wait(0, NULL));
689 EXPECT_EQ(MOJO_RESULT_OK,
701 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, false));
702 EXPECT_EQ(10u * sizeof(int32_t), num_bytes);
707 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(buffer, &num_bytes, false));
708 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
712 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
719 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, false));
720 EXPECT_EQ(8u * sizeof(int32_t), num_bytes);
727 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(buffer, &num_bytes, false));
728 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
735 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
742 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, false));
743 EXPECT_EQ(1u * sizeof(int32_t), num_bytes);
750 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, false));
751 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
758 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(buffer, &num_bytes, false));
759 EXPECT_EQ(10u * sizeof(int32_t), num_bytes);
771 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
780 EXPECT_EQ(MOJO_RESULT_OK,
783 EXPECT_EQ(6u * sizeof(int32_t), num_bytes);
785 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerEndWriteData(6u * sizeof(int32_t)));
793 EXPECT_EQ(MOJO_RESULT_OK,
795 EXPECT_EQ(4u * sizeof(int32_t), num_bytes);
797 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerEndWriteData(1u * sizeof(int32_t)));
804 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
811 EXPECT_EQ(MOJO_RESULT_OK,
813 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
816 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerEndWriteData(4u * sizeof(int32_t)));
824 EXPECT_EQ(MOJO_RESULT_OK,
826 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
829 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerEndWriteData(3u * sizeof(int32_t)));
836 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(buffer, &num_bytes, false));
837 EXPECT_EQ(8u * sizeof(int32_t), num_bytes);
847 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
861 EXPECT_EQ(MOJO_RESULT_OK,
870 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
875 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
876 EXPECT_EQ(0u, num_bytes);
881 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, true));
882 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
886 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
887 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
892 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
898 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
902 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
906 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
912 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, true));
913 EXPECT_EQ(2u * sizeof(int32_t), num_bytes);
918 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, true));
919 EXPECT_EQ(3u * sizeof(int32_t), num_bytes);
923 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
924 EXPECT_EQ(10u * sizeof(int32_t), num_bytes);
929 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(buffer, &num_bytes, true));
930 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
933 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
938 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
941 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
945 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
950 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerDiscardData(&num_bytes, true));
951 EXPECT_EQ(2u * sizeof(int32_t), num_bytes);
955 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
956 EXPECT_EQ(3u * sizeof(int32_t), num_bytes);
964 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
967 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
971 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
977 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(buffer, &num_bytes, true));
978 EXPECT_EQ(2u * sizeof(int32_t), num_bytes);
981 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
985 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerDiscardData(&num_bytes, true));
986 EXPECT_EQ(1u * sizeof(int32_t), num_bytes);
990 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
991 EXPECT_EQ(0u, num_bytes);
1004 EXPECT_EQ(MOJO_RESULT_OK,
1013 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
1019 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, true));
1020 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
1025 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, true));
1026 EXPECT_EQ(9u * sizeof(int32_t), num_bytes);
1031 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(buffer, &num_bytes, true));
1032 EXPECT_EQ(1u * sizeof(int32_t), num_bytes);
1036 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
1041 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
1044 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
1048 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
1053 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerDiscardData(&num_bytes, true));
1057 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1058 EXPECT_EQ(5u * sizeof(int32_t), num_bytes);
1063 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, true));
1064 EXPECT_EQ(10u * sizeof(int32_t), num_bytes);
1069 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerReadData(buffer, &num_bytes, true));
1071 EXPECT_EQ(10u * sizeof(int32_t), num_bytes);
1073 EXPECT_EQ(0, memcmp(buffer, expected_buffer, sizeof(buffer)));
1090 EXPECT_EQ(MOJO_RESULT_OK,
1098 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
1106 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
1112 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
1118 EXPECT_EQ(MOJO_RESULT_OK,
1124 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerEndWriteData(5u * sizeof(int32_t)));
1130 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
1136 EXPECT_EQ(MOJO_RESULT_OK,
1139 EXPECT_EQ(0, static_cast<const int32_t*>(read_ptr)[0]);
1140 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerEndReadData(1u * sizeof(int32_t)));
1144 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1145 EXPECT_EQ(4u * sizeof(int32_t), num_bytes);
1151 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
1158 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(buffer, &num_bytes, true));
1159 EXPECT_EQ(6u * sizeof(int32_t), num_bytes);
1163 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1164 EXPECT_EQ(10u * sizeof(int32_t), num_bytes);
1169 EXPECT_EQ(MOJO_RESULT_OUT_OF_RANGE,
1178 EXPECT_EQ(MOJO_RESULT_OK,
1181 EXPECT_EQ(1, static_cast<const int32_t*>(read_ptr)[0]);
1182 EXPECT_EQ(2, static_cast<const int32_t*>(read_ptr)[1]);
1183 EXPECT_EQ(3, static_cast<const int32_t*>(read_ptr)[2]);
1184 EXPECT_EQ(4, static_cast<const int32_t*>(read_ptr)[3]);
1185 EXPECT_EQ(100, static_cast<const int32_t*>(read_ptr)[4]);
1186 EXPECT_EQ(101, static_cast<const int32_t*>(read_ptr)[5]);
1187 EXPECT_EQ(102, static_cast<const int32_t*>(read_ptr)[6]);
1188 EXPECT_EQ(103, static_cast<const int32_t*>(read_ptr)[7]);
1189 EXPECT_EQ(104, static_cast<const int32_t*>(read_ptr)[8]);
1190 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerEndReadData(9u * sizeof(int32_t)));
1195 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
1217 EXPECT_EQ(MOJO_RESULT_OK,
1227 EXPECT_EQ(MOJO_RESULT_OK,
1229 EXPECT_EQ(20u, num_bytes);
1234 EXPECT_EQ(MOJO_RESULT_OK,
1236 EXPECT_EQ(10u, num_bytes);
1237 EXPECT_EQ(0, memcmp(read_buffer, &test_data[0], 10u));
1244 EXPECT_EQ(MOJO_RESULT_OK,
1247 EXPECT_EQ(80u, num_bytes);
1248 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerEndWriteData(0u));
1253 EXPECT_EQ(MOJO_RESULT_OK,
1255 EXPECT_EQ(90u, num_bytes);
1262 EXPECT_EQ(MOJO_RESULT_OK,
1265 EXPECT_EQ(90u, num_bytes);
1266 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerEndReadData(0u));
1273 EXPECT_EQ(MOJO_RESULT_OK,
1275 EXPECT_EQ(100u, num_bytes);
1276 EXPECT_EQ(0, memcmp(read_buffer, &test_data[10], 100u));
1295 EXPECT_EQ(MOJO_RESULT_OK,
1304 EXPECT_EQ(MOJO_RESULT_OK,
1306 EXPECT_EQ(kTestDataSize, num_bytes);
1310 EXPECT_EQ(MOJO_RESULT_OK,
1312 EXPECT_EQ(kTestDataSize, num_bytes);
1317 EXPECT_EQ(MOJO_RESULT_OK,
1325 EXPECT_EQ(MOJO_RESULT_OK,
1328 EXPECT_EQ(2u * kTestDataSize, num_bytes);
1334 EXPECT_EQ(0, memcmp(read_buffer_ptr, kTestData, kTestDataSize));
1335 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerEndReadData(kTestDataSize));
1340 EXPECT_EQ(MOJO_RESULT_OK,
1343 EXPECT_EQ(kTestDataSize, num_bytes);
1355 EXPECT_EQ(MOJO_RESULT_OK,
1357 EXPECT_EQ(kTestDataSize, num_bytes);
1362 EXPECT_EQ(MOJO_RESULT_OK,
1370 EXPECT_EQ(MOJO_RESULT_OK,
1373 EXPECT_EQ(kTestDataSize, num_bytes);
1383 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerEndWriteData(kTestDataSize));
1387 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
1393 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
1407 EXPECT_EQ(MOJO_RESULT_OK,
1422 EXPECT_EQ(MOJO_RESULT_OK,
1424 EXPECT_EQ(kTestDataSize, num_bytes);
1432 EXPECT_EQ(MOJO_RESULT_OK,
1434 EXPECT_EQ(kTestDataSize, num_bytes);
1435 EXPECT_EQ(0, memcmp(buffer, kTestData, kTestDataSize));
1439 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
1445 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
1450 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
1465 EXPECT_EQ(MOJO_RESULT_OK,
1472 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1473 EXPECT_EQ(0u, num_bytes);
1476 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
1481 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1482 EXPECT_EQ(0u, num_bytes);
1487 EXPECT_EQ(MOJO_RESULT_OK,
1489 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
1494 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, dp->ProducerEndWriteData(0u));
1498 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1499 EXPECT_EQ(0u, num_bytes);
1505 EXPECT_EQ(MOJO_RESULT_OK,
1508 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, dp->ProducerEndWriteData(1u));
1511 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, dp->ProducerEndWriteData(0u));
1515 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1516 EXPECT_EQ(0u, num_bytes);
1521 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(&element, &num_bytes, false));
1525 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1526 EXPECT_EQ(1u * sizeof(int32_t), num_bytes);
1529 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
1534 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1535 EXPECT_EQ(1u * sizeof(int32_t), num_bytes);
1540 EXPECT_EQ(MOJO_RESULT_OK,
1542 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
1548 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1549 EXPECT_EQ(1u * sizeof(int32_t), num_bytes);
1555 EXPECT_EQ(MOJO_RESULT_OK,
1557 EXPECT_EQ(1u * sizeof(int32_t), num_bytes);
1558 EXPECT_EQ(123, static_cast<const int32_t*>(read_ptr)[0]);
1559 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, dp->ConsumerEndReadData(1u));
1563 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerQueryData(&num_bytes));
1564 EXPECT_EQ(1u * sizeof(int32_t), num_bytes);
1585 EXPECT_EQ(MOJO_RESULT_OK,
1593 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(elements, &num_bytes, false));
1594 EXPECT_EQ(2u, num_bytes);
1599 EXPECT_EQ(MOJO_RESULT_OK,
1601 EXPECT_EQ(2u, num_bytes);
1602 EXPECT_EQ('a', static_cast<const char*>(read_ptr)[0]);
1603 EXPECT_EQ('b', static_cast<const char*>(read_ptr)[1]);
1610 // EXPECT_EQ(MOJO_RESULT_SHOULD_WAIT,
1614 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(elements, &num_bytes, false));
1617 EXPECT_EQ('a', static_cast<const char*>(read_ptr)[0]);
1618 EXPECT_EQ('b', static_cast<const char*>(read_ptr)[1]);
1621 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerEndReadData(2u));
1624 EXPECT_EQ(MOJO_RESULT_OK, dp->ProducerWriteData(elements, &num_bytes, false));
1629 EXPECT_EQ(MOJO_RESULT_OK,
1631 EXPECT_EQ(2u, num_bytes);
1632 EXPECT_EQ('x', static_cast<const char*>(read_ptr)[0]);
1633 EXPECT_EQ('y', static_cast<const char*>(read_ptr)[1]);
1636 EXPECT_EQ(MOJO_RESULT_OK, dp->ConsumerEndReadData(2u));