Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85714208 authored by Michael Butler's avatar Michael Butler
Browse files

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 42a35bee)
parent 3a4601ba
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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;

+7 −4
Original line number Diff line number Diff line
@@ -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
+7 −4
Original line number Diff line number Diff line
@@ -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;

+7 −4
Original line number Diff line number Diff line
@@ -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
+7 −4
Original line number Diff line number Diff line
@@ -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;

Loading