MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST_F

Function TEST_F

tensorflow/core/common_runtime/buf_rendezvous_test.cc:79–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77const uint64 BufRendezvousTest::kDefaultIncarnation = 12345;
78
79TEST_F(BufRendezvousTest, CorrectUseProducerFirst) {
80 Status prod_status;
81 Status cons_status;
82 bool prod_callback_called = false;
83 bool cons_callback_called = false;
84 Notification note;
85 br_->ProvideBuf(
86 *kDefaultKey, default_device_, fake_device_context_, &a_, aa_,
87 [&note, &prod_status, &prod_callback_called](const Status& s) {
88 prod_status = s;
89 prod_callback_called = true;
90 note.Notify();
91 });
92 EXPECT_FALSE(prod_callback_called);
93 br_->ConsumeBuf(*kDefaultKey, *kDefaultDeviceName, kDefaultIncarnation,
94 [this, &cons_status, &cons_callback_called](
95 const Status& s, BufRendezvous::Hook* h) {
96 cons_status = s;
97 cons_callback_called = true;
98 ASSERT_TRUE(h != nullptr);
99 EXPECT_EQ(h->prod_dev, default_device_);
100 EXPECT_EQ(h->prod_ctx, fake_device_context_);
101 EXPECT_EQ(h->prod_value, &a_);
102 br_->DoneWithHook(h);
103 });
104 EXPECT_TRUE(cons_callback_called);
105 note.WaitForNotification();
106 EXPECT_TRUE(prod_callback_called);
107 TF_EXPECT_OK(cons_status);
108 TF_EXPECT_OK(prod_status);
109}
110
111TEST_F(BufRendezvousTest, CorrectUseConsumerFirst) {
112 Status prod_status;

Callers

nothing calls this directly

Calls 11

InternalFunction · 0.85
ProvideBufMethod · 0.80
ConsumeBufMethod · 0.80
DoneWithHookMethod · 0.80
StrCatFunction · 0.50
NotifyMethod · 0.45
WaitForNotificationMethod · 0.45
okMethod · 0.45
resetMethod · 0.45
StartAbortMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected