summaryrefslogtreecommitdiff
path: root/nn/runtime/test/TestValidation.cpp
diff options
context:
space:
mode:
authorSlava Shklyaev <slavash@google.com>2020-03-20 14:30:53 +0000
committerSlava Shklyaev <slavash@google.com>2020-03-20 14:30:53 +0000
commit1faaa3ade7d062960ba804d0b4e784fc5e5e4179 (patch)
treeeb617a98bba999261bcef2ce1e1213815d9efdda /nn/runtime/test/TestValidation.cpp
parentd78470d41e24105248d728248d76b96d4e265d91 (diff)
downloadml-1faaa3ade7d062960ba804d0b4e784fc5e5e4179.tar.gz
Add validation tests for ANN_setLoopTimeout
Also adds mStarted validation. Fix: 149819396 Test: NNT_static Change-Id: I2f947a4ead527b7cff6bf93439c3295e59626f7a
Diffstat (limited to 'nn/runtime/test/TestValidation.cpp')
-rw-r--r--nn/runtime/test/TestValidation.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/nn/runtime/test/TestValidation.cpp b/nn/runtime/test/TestValidation.cpp
index 9e1f910ce..93570f4e1 100644
--- a/nn/runtime/test/TestValidation.cpp
+++ b/nn/runtime/test/TestValidation.cpp
@@ -1089,6 +1089,10 @@ TEST_F(ValidationTestCompilation, ExecutionUsability) {
auto testTooLate = [this, execution, &in0, &out0, memory] {
// Try a bunch of things that are impermissible if the execution has started.
+ // Set loop timeout.
+ ASSERT_EQ(ANeuralNetworksExecution_setLoopTimeout(execution, kShortWaitInNanoseconds),
+ ANEURALNETWORKS_BAD_STATE);
+
// Set inputs and outputs.
ASSERT_EQ(ANeuralNetworksExecution_setInput(execution, 0, nullptr, &in0, sizeof(in0)),
ANEURALNETWORKS_BAD_STATE);
@@ -1175,6 +1179,11 @@ TEST_F(ValidationTestCompilation, ExecutionUsability) {
}
}
+TEST_F(ValidationTestExecution, SetLoopTimeout) {
+ EXPECT_EQ(ANeuralNetworksExecution_setLoopTimeout(nullptr, kShortWaitInNanoseconds),
+ ANEURALNETWORKS_UNEXPECTED_NULL);
+}
+
TEST_F(ValidationTestExecution, SetInput) {
char buffer[20];
EXPECT_EQ(ANeuralNetworksExecution_setInput(nullptr, 0, nullptr, buffer, sizeof(float)),