| 109 | } |
| 110 | |
| 111 | TEST(QueueRunnerTest, BasicTest) { |
| 112 | GraphDef graph_def = BuildSimpleGraph(); |
| 113 | auto session = BuildSessionAndInitVariable(graph_def); |
| 114 | |
| 115 | QueueRunnerDef queue_runner_def = BuildQueueRunnerDef( |
| 116 | kQueueName, {kCountUpToOpName}, kSquareOpName, "", {}); |
| 117 | |
| 118 | std::unique_ptr<QueueRunner> qr; |
| 119 | TF_EXPECT_OK(QueueRunner::New(queue_runner_def, &qr)); |
| 120 | TF_CHECK_OK(qr->Start(session.get())); |
| 121 | TF_EXPECT_OK(qr->Join()); |
| 122 | |
| 123 | std::vector<Tensor> outputs; |
| 124 | TF_EXPECT_OK(session->Run({}, {kSquareOpName}, {}, &outputs)); |
| 125 | int square_value = *outputs[0].scalar<int>().data(); |
| 126 | EXPECT_EQ(square_value, 100); |
| 127 | } |
| 128 | |
| 129 | TEST(QueueRunnerTest, QueueClosedCode) { |
| 130 | GraphDef graph_def = BuildSimpleGraph(); |
nothing calls this directly
no test coverage detected