diff options
author | Michael Butler <butlermichael@google.com> | 2020-05-01 20:28:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-05-01 20:28:59 +0000 |
commit | 55bee1c40e56f690de39bae8e47a4b6f9743086c (patch) | |
tree | b29caad6c8b5e9584cfd959e5c2d573b2f390541 /nn/runtime/test | |
parent | 1b4aaf1c31ac46e03d014ffe2e2e7bef86fb3dc1 (diff) | |
parent | b9c1528ed7e13d2826905e46a4d2efea618f34d8 (diff) | |
download | ml-55bee1c40e56f690de39bae8e47a4b6f9743086c.tar.gz |
Merge "Add more NN priority validation tests" into rvc-dev
Diffstat (limited to 'nn/runtime/test')
-rw-r--r-- | nn/runtime/test/TestValidation.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nn/runtime/test/TestValidation.cpp b/nn/runtime/test/TestValidation.cpp index cf79d972f..181d39957 100644 --- a/nn/runtime/test/TestValidation.cpp +++ b/nn/runtime/test/TestValidation.cpp @@ -1109,6 +1109,19 @@ TEST_F(ValidationTestCompilation, SetCaching) { TEST_F(ValidationTestCompilation, SetPriority) { EXPECT_EQ(ANeuralNetworksCompilation_setPriority(nullptr, ANEURALNETWORKS_PRIORITY_DEFAULT), ANEURALNETWORKS_UNEXPECTED_NULL); + + // Test invalid values of priority. + constexpr int kInvalidPriorities[] = {0, + ANEURALNETWORKS_PRIORITY_LOW - 1, + ANEURALNETWORKS_PRIORITY_LOW + 1, + ANEURALNETWORKS_PRIORITY_MEDIUM - 1, + ANEURALNETWORKS_PRIORITY_MEDIUM + 1, + ANEURALNETWORKS_PRIORITY_HIGH - 1, + ANEURALNETWORKS_PRIORITY_HIGH + 1}; + for (int invalidPriority : kInvalidPriorities) { + EXPECT_EQ(ANeuralNetworksCompilation_setPriority(mCompilation, invalidPriority), + ANEURALNETWORKS_BAD_DATA); + } } // Also see TEST_F(ValidationTestCompilationForDevices_1, SetTimeout) |