tensorflow/lite/experimental/acceleration/mini_benchmark/call_test.cc
// Note: For the tests below the error messages returned by the error reporter
// are of the following format:
// "<filename>:<line number> <error message>. Node <number name> failed to
// prepare.\n"
// It's sufficient to test whether the string returned by error reporter
// contains the expected error message.
For the tests below the error messages returned by the error reporter
are of the following format:
": . Node  failed to
prepare.\n"
It's sufficient to test whether the string returned by error reporter
contains the expected error message.
For the tests below the error messages returned by the error reporter are of the following format : " : . Node failed to prepare . \ n " It ' s sufficient to test whether the string returned by error reporter contains the expected error message .
TEST_F(CallTest, ShouldFailWith0DInputs) {
  AddSubgraphs(1);
  int loop_count = 5;
  builder_->BuildMulSubgraph(interpreter_->subgraph(1));
  interpreter_->subgraph(1)->ResizeInputTensor(0, {});
  interpreter_->subgraph(1)->ResizeInputTensor(1, {});
  CallTest::BuildCallSubgraph(&interpreter_->primary_subgraph(), 1, loop_count,
                              {0, 1}, {2});
  ASSERT_EQ(interpreter_->AllocateTensors(), kTfLiteError);
  EXPECT_THAT(
      error_reporter_.error_messages(),
      testing::HasSubstr(
          "Dimensions of all of call node's inputs should be non-zero."));
}
TEST_F ( CallTest , ShouldFailWith0DInputs ) { AddSubgraphs ( 1 ) ; int loop_count = 5 ; builder_ -> BuildMulSubgraph ( interpreter_ -> subgraph ( 1 ) ) ; interpreter_ -> subgraph ( 1 ) -> ResizeInputTensor ( 0 , { } ) ; interpreter_ -> subgraph ( 1 ) -> ResizeInputTensor ( 1 , { } ) ; CallTest :: BuildCallSubgraph ( & interpreter_ -> primary_subgraph ( ) , 1 , loop_count , { 0 , 1 } , { 2 } ) ; ASSERT_EQ ( interpreter_ -> AllocateTensors ( ) , kTfLiteError ) ; EXPECT_THAT ( error_reporter_ . error_messages ( ) , testing :: HasSubstr ( " " ) ) ; }
Note: For the tests below the error messages returned by the error reporter
are of the following format:
"<filename>:<line number> <error message>.
Note : For the tests below the error messages returned by the error reporter are of the following format : " <filename > : <line number > <error message > .