diff options
author | Michael Butler <butlermichael@google.com> | 2019-02-12 13:50:25 -0800 |
---|---|---|
committer | Michael Butler <butlermichael@google.com> | 2019-02-15 13:34:50 -0800 |
commit | 857142085f984d3d218152d7da4d57c2201d94e9 (patch) | |
tree | 633b62dd840699d002dee6e8b0be86a51d54ac36 /neuralnetworks | |
parent | 3a4601ba483899cebd53a6a42f81378f1f70fbda (diff) | |
download | platform_hardware_interfaces-857142085f984d3d218152d7da4d57c2201d94e9.tar.gz platform_hardware_interfaces-857142085f984d3d218152d7da4d57c2201d94e9.tar.bz2 platform_hardware_interfaces-857142085f984d3d218152d7da4d57c2201d94e9.zip |
Pretty-print ErrorStatus and DeviceStatus test failure logs
Argument-dependent lookup will only work for operator>> if the operator
is in one of the argument's namespaces. This caused the enumerations to
pretty-print for V1_0, but not for V1_1 or V1_2. This change ensures the
V1_0 namespace is used.
Test: mma
Test: atest VtsHalNeuralnetworksV1_0TargetTest (verified the test output "OFFLINE" for DeviceStatus and "DEVICE_UNAVAILABLE" for ErrorStatus instead of raw byte value representation)
Test: atest VtsHalNeuralnetworksV1_1TargetTest (verified the test output "OFFLINE" for DeviceStatus and "DEVICE_UNAVAILABLE" for ErrorStatus instead of raw byte value representation)
Test: atest VtsHalNeuralnetworksV1_2TargetTest (verified ran and passed tests)
Fixes: 124316129
Change-Id: I764a46e2d87615b1f3da0ab0e6edb134bb533887
(cherry picked from commit 42a35bee10225e6257d145f0cb88e2a612a35721)
Diffstat (limited to 'neuralnetworks')
6 files changed, 42 insertions, 24 deletions
diff --git a/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworks.cpp b/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworks.cpp index 1ff3b66808..9ebc0aac47 100644 --- a/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworks.cpp +++ b/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworks.cpp @@ -60,6 +60,12 @@ void NeuralnetworksHidlTest::TearDown() { } // namespace functional } // namespace vts +} // namespace V1_0 +} // namespace neuralnetworks +} // namespace hardware +} // namespace android + +namespace android::hardware::neuralnetworks::V1_0 { ::std::ostream& operator<<(::std::ostream& os, ErrorStatus errorStatus) { return os << toString(errorStatus); @@ -69,10 +75,7 @@ void NeuralnetworksHidlTest::TearDown() { return os << toString(deviceStatus); } -} // namespace V1_0 -} // namespace neuralnetworks -} // namespace hardware -} // namespace android +} // namespace android::hardware::neuralnetworks::V1_0 using android::hardware::neuralnetworks::V1_0::vts::functional::NeuralnetworksHidlEnvironment; diff --git a/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworks.h index e79129b09f..d4c114d3a2 100644 --- a/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworks.h +++ b/neuralnetworks/1.0/vts/functional/VtsHalNeuralnetworks.h @@ -72,14 +72,17 @@ class GeneratedTest : public NeuralnetworksHidlTest {}; } // namespace functional } // namespace vts +} // namespace V1_0 +} // namespace neuralnetworks +} // namespace hardware +} // namespace android + +namespace android::hardware::neuralnetworks::V1_0 { // pretty-print values for error messages ::std::ostream& operator<<(::std::ostream& os, ErrorStatus errorStatus); ::std::ostream& operator<<(::std::ostream& os, DeviceStatus deviceStatus); -} // namespace V1_0 -} // namespace neuralnetworks -} // namespace hardware -} // namespace android +} // namespace android::hardware::neuralnetworks::V1_0 #endif // VTS_HAL_NEURALNETWORKS_V1_0_TARGET_TESTS_H diff --git a/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.cpp b/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.cpp index 62381e6796..4165953df2 100644 --- a/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.cpp +++ b/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.cpp @@ -60,6 +60,12 @@ void NeuralnetworksHidlTest::TearDown() { } // namespace functional } // namespace vts +} // namespace V1_1 +} // namespace neuralnetworks +} // namespace hardware +} // namespace android + +namespace android::hardware::neuralnetworks::V1_0 { ::std::ostream& operator<<(::std::ostream& os, ErrorStatus errorStatus) { return os << toString(errorStatus); @@ -69,10 +75,7 @@ void NeuralnetworksHidlTest::TearDown() { return os << toString(deviceStatus); } -} // namespace V1_1 -} // namespace neuralnetworks -} // namespace hardware -} // namespace android +} // namespace android::hardware::neuralnetworks::V1_0 using android::hardware::neuralnetworks::V1_1::vts::functional::NeuralnetworksHidlEnvironment; diff --git a/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h index 970e8b5537..1c8c0e18cb 100644 --- a/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h +++ b/neuralnetworks/1.1/vts/functional/VtsHalNeuralnetworks.h @@ -81,14 +81,17 @@ class GeneratedTest : public NeuralnetworksHidlTest {}; } // namespace functional } // namespace vts +} // namespace V1_1 +} // namespace neuralnetworks +} // namespace hardware +} // namespace android + +namespace android::hardware::neuralnetworks::V1_0 { // pretty-print values for error messages ::std::ostream& operator<<(::std::ostream& os, ErrorStatus errorStatus); ::std::ostream& operator<<(::std::ostream& os, DeviceStatus deviceStatus); -} // namespace V1_1 -} // namespace neuralnetworks -} // namespace hardware -} // namespace android +} // namespace android::hardware::neuralnetworks::V1_0 #endif // VTS_HAL_NEURALNETWORKS_V1_1_H diff --git a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.cpp b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.cpp index 4eced82352..34c73ef05d 100644 --- a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.cpp +++ b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.cpp @@ -66,6 +66,12 @@ sp<IPreparedModel> getPreparedModel_1_2( } // namespace functional } // namespace vts +} // namespace V1_2 +} // namespace neuralnetworks +} // namespace hardware +} // namespace android + +namespace android::hardware::neuralnetworks::V1_0 { ::std::ostream& operator<<(::std::ostream& os, ErrorStatus errorStatus) { return os << toString(errorStatus); @@ -75,10 +81,7 @@ sp<IPreparedModel> getPreparedModel_1_2( return os << toString(deviceStatus); } -} // namespace V1_2 -} // namespace neuralnetworks -} // namespace hardware -} // namespace android +} // namespace android::hardware::neuralnetworks::V1_0 using android::hardware::neuralnetworks::V1_2::vts::functional::NeuralnetworksHidlEnvironment; diff --git a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h index c0c21bddf0..404eec06db 100644 --- a/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h +++ b/neuralnetworks/1.2/vts/functional/VtsHalNeuralnetworks.h @@ -88,14 +88,17 @@ sp<IPreparedModel> getPreparedModel_1_2( } // namespace functional } // namespace vts +} // namespace V1_2 +} // namespace neuralnetworks +} // namespace hardware +} // namespace android + +namespace android::hardware::neuralnetworks::V1_0 { // pretty-print values for error messages ::std::ostream& operator<<(::std::ostream& os, ErrorStatus errorStatus); ::std::ostream& operator<<(::std::ostream& os, DeviceStatus deviceStatus); -} // namespace V1_2 -} // namespace neuralnetworks -} // namespace hardware -} // namespace android +} // namespace android::hardware::neuralnetworks::V1_0 #endif // VTS_HAL_NEURALNETWORKS_V1_2_H |