Project import generated by Copybara.

GitOrigin-RevId: 1138530ad1578c5d6615b3e3d041775c75d310c4
This commit is contained in:
MediaPipe Team
2019-09-11 14:29:38 -07:00
committed by jqtang
parent 423c21b454
commit 61bc4556af
173 changed files with 1806 additions and 1824 deletions
@@ -117,7 +117,7 @@ TEST_F(ParallelExecutionTest, SlowPlusOneCalculatorsTest) {
CalculatorGraph graph(graph_config);
// Runs the graph twice.
for (int i = 0; i < 2; ++i) {
MEDIAPIPE_ASSERT_OK(graph.StartRun(
MP_ASSERT_OK(graph.StartRun(
{{"callback", MakePacket<std::function<void(const Packet&)>>(std::bind(
&ParallelExecutionTest::AddThreadSafeVectorSink, this,
std::placeholders::_1))}}));
@@ -134,15 +134,15 @@ TEST_F(ParallelExecutionTest, SlowPlusOneCalculatorsTest) {
EXPECT_EQ(0, fail_count);
// Doesn't wait but just close the input stream.
MEDIAPIPE_ASSERT_OK(graph.CloseInputStream("input"));
MP_ASSERT_OK(graph.CloseInputStream("input"));
// Waits properly via the API until the graph is done.
MEDIAPIPE_ASSERT_OK(graph.WaitUntilDone());
MP_ASSERT_OK(graph.WaitUntilDone());
absl::ReaderMutexLock lock(&output_packets_mutex_);
ASSERT_EQ(kTotalNums - kTotalNums / 4, output_packets_.size());
int index = 1;
for (const Packet& packet : output_packets_) {
MEDIAPIPE_ASSERT_OK(packet.ValidateAsType<int>());
MP_ASSERT_OK(packet.ValidateAsType<int>());
EXPECT_EQ(index + 2, packet.Get<int>());
EXPECT_EQ(Timestamp(index), packet.Timestamp());
if (++index % 4 == 0) {