diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-06 20:41:12 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-06 20:41:12 +0000 |
commit | 2912d2d2dbea69824b089ccd24f72ffa0355a64b (patch) | |
tree | 599fce2ebe81c58d468695203d147556507867b2 | |
parent | 44cc5755cd14076b7dd1fab259cd71d5173a76f2 (diff) | |
parent | 17c8b2c5458cddf6a08e00a58ab71ee8f838261e (diff) | |
download | hidl-2912d2d2dbea69824b089ccd24f72ffa0355a64b.tar.gz |
Snap for 8414339 from 17c8b2c5458cddf6a08e00a58ab71ee8f838261e to tm-qpr1-release
Change-Id: Ic62b38e818244cdc4a1f4a1419322c93884e5bfe
-rw-r--r-- | ConstantExpression.cpp | 6 | ||||
-rw-r--r-- | TEST_MAPPING | 14 | ||||
-rw-r--r-- | hidl-gen_l.ll | 8 | ||||
-rw-r--r-- | test/lazy_test/hidl_lazy_test.cpp | 10 |
4 files changed, 35 insertions, 3 deletions
diff --git a/ConstantExpression.cpp b/ConstantExpression.cpp index 02fbf760..6930c0f4 100644 --- a/ConstantExpression.cpp +++ b/ConstantExpression.cpp @@ -137,6 +137,11 @@ T handleBinaryCommon(T lval, const std::string& op, T rval) { return static_cast<T>(0xdeadbeef); } +// The compiler doesn't know T is at least KIND_INT32, and will instantiate bool +// version of this function, and will warn about converting the result of '<<' +// to a boolean. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wint-in-bool-context" template <class T> T handleShift(T lval, const std::string& op, int64_t rval) { // just cast rval to int64_t and it should fit. @@ -147,6 +152,7 @@ T handleShift(T lval, const std::string& op, int64_t rval) { << lval << " " << op << " " << rval; return static_cast<T>(0xdeadbeef); } +#pragma GCC diagnostic pop bool handleLogical(bool lval, const std::string& op, bool rval) { COMPUTE_BINARY(||); diff --git a/TEST_MAPPING b/TEST_MAPPING index 13ed681d..b3c422b9 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -12,5 +12,19 @@ { "name": "hidl_lazy_test" } + ], + "hwasan-postsubmit": [ + { + "name": "hidl_test" + }, + { + "name": "hidl_test_java" + }, + { + "name": "libhidl-gen-utils_test" + }, + { + "name": "hidl_lazy_test" + } ] } diff --git a/hidl-gen_l.ll b/hidl-gen_l.ll index 007cd4ce..34baa283 100644 --- a/hidl-gen_l.ll +++ b/hidl-gen_l.ll @@ -65,6 +65,14 @@ using token = yy::parser::token; #define YY_DECL int yylex(YYSTYPE* yylval_param, YYLTYPE* yylloc_param, \ yyscan_t yyscanner, android::AST* const ast, android::Scope** const scope) +#ifndef YYSTYPE +#define YYSTYPE yy::parser::semantic_type +#endif + +#ifndef YYLTYPE +#define YYLTYPE yy::parser::location_type +#endif + #define YY_USER_ACTION yylloc->step(); yylloc->columns(yyleng); %} diff --git a/test/lazy_test/hidl_lazy_test.cpp b/test/lazy_test/hidl_lazy_test.cpp index af0e6b97..6bbb161f 100644 --- a/test/lazy_test/hidl_lazy_test.cpp +++ b/test/lazy_test/hidl_lazy_test.cpp @@ -25,6 +25,7 @@ #include <sys/eventfd.h> #include <unistd.h> +#include <android-base/properties.h> #include <android-base/unique_fd.h> #include <android/hardware/tests/lazy/1.1/ILazy.h> #include <android/hardware/tests/lazy_cb/1.0/ILazyCb.h> @@ -101,7 +102,8 @@ class HidlLazyTest : public HidlLazyTestBase { std::cout << "Waiting " << SHUTDOWN_WAIT_TIME << " seconds before checking that the " << "service has shut down." << std::endl; IPCThreadState::self()->flushCommands(); - sleep(SHUTDOWN_WAIT_TIME); + int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1); + sleep(SHUTDOWN_WAIT_TIME * timeout_multiplier); for (const auto& instance : gInstances) { ASSERT_FALSE(isServiceRunning(instance)) << "Service failed to shutdown " << instance.string(); @@ -143,7 +145,8 @@ static void testWithTimes(const std::vector<size_t>& waitTimes, const FqInstance IPCThreadState::self()->flushCommands(); std::cout << "Thread for " << instance.string() << " waiting " << sleepTime << " while not holding HAL." << std::endl; - sleep(sleepTime); + int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1); + sleep(sleepTime * timeout_multiplier); sp<IBase> hal = getHal(instance); ASSERT_NE(hal.get(), nullptr); ASSERT_TRUE(hal->ping().isOk()); @@ -230,7 +233,8 @@ TEST_F(HidlLazyCbTest, ActiveServicesCallbackTest) { << " seconds before checking whether the " << "service is still running." << std::endl; - sleep(CALLBACK_SHUTDOWN_WAIT_TIME); + int timeout_multiplier = android::base::GetIntProperty("ro.hw_timeout_multiplier", 1); + sleep(CALLBACK_SHUTDOWN_WAIT_TIME * timeout_multiplier); ASSERT_FALSE(isServiceRunning(fqInstance)) << "Service failed to shut down."; } |