| 75 | }; |
| 76 | |
| 77 | TEST_F(VariableOpsTest, TestAssignThenReadVariable) { |
| 78 | ASSERT_EQ(interpreter_.AllocateTensors(), kTfLiteOk); |
| 79 | TfLiteTensor* input_assign_index = interpreter_.tensor(0); |
| 80 | input_assign_index->data.i32[0] = 1; |
| 81 | TfLiteTensor* input_read_index = interpreter_.tensor(1); |
| 82 | input_read_index->data.i32[0] = 1; |
| 83 | TfLiteTensor* input_data_index = interpreter_.tensor(2); |
| 84 | input_data_index->data.f[0] = 1717; |
| 85 | ASSERT_EQ(interpreter_.Invoke(), kTfLiteOk); |
| 86 | |
| 87 | // Verify output. |
| 88 | TfLiteTensor* output = interpreter_.tensor(3); |
| 89 | ASSERT_EQ(output->dims->size, 0); |
| 90 | EXPECT_EQ(output->data.f[0], 1717); |
| 91 | } |
| 92 | |
| 93 | TEST_F(VariableOpsTest, TestReadVariableBeforeAssign) { |
| 94 | ASSERT_EQ(interpreter_.AllocateTensors(), kTfLiteOk); |
nothing calls this directly
no test coverage detected