Loading automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -96,11 +96,12 @@ bool JsonFakeValueGenerator::hasNext() { std::vector<VehiclePropValue> JsonFakeValueGenerator::parseFakeValueJson(std::istream& is) { std::vector<VehiclePropValue> fakeVhalEvents; Json::Reader reader; Json::CharReaderBuilder builder; Json::Value rawEvents; if (!reader.parse(is, rawEvents)) { std::string errorMessage; if (!Json::parseFromStream(builder, is, &rawEvents, &errorMessage)) { ALOGE("%s: Failed to parse fake data JSON file. Error: %s", __func__, reader.getFormattedErrorMessages().c_str()); errorMessage.c_str()); return fakeVhalEvents; } Loading biometrics/common/aidl/OWNERS 0 → 100644 +2 −0 Original line number Diff line number Diff line ilyamaty@google.com kchyn@google.com broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp +56 −0 Original line number Diff line number Diff line Loading @@ -485,6 +485,50 @@ TEST_P(BroadcastRadioHalTest, TuneFailsWithInvalid) { } } /** * Test tuning with DAB selector. * * Verifies that: * - if DAB selector is not supported, the method returns NOT_SUPPORTED; * - if it is supported, the method succeeds; * - after a successful tune call, onCurrentProgramInfoChanged callback is * invoked carrying a proper selector; * - program changes exactly to what was requested. */ TEST_F(BroadcastRadioHalTest, DabTune) { ASSERT_TRUE(openSession()); ProgramSelector sel = {}; uint64_t freq = 178352; sel.primaryId = make_identifier(IdentifierType::DAB_FREQUENCY,freq); std::this_thread::sleep_for(gTuneWorkaround); // try tuning ProgramInfo infoCb = {}; EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChanged_, InfoHasId(utils::make_identifier(IdentifierType::DAB_FREQUENCY, freq))) .Times(AnyNumber()) .WillOnce(DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(Void())))); auto result = mSession->tune(sel); // expect a failure if it's not supported if (!utils::isSupported(mProperties, sel)) { EXPECT_EQ(Result::NOT_SUPPORTED, result); return; } // expect a callback if it succeeds EXPECT_EQ(Result::OK, result); EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChanged_, timeout::tune); LOG(DEBUG) << "current program info: " << toString(infoCb); // it should tune exactly to what was requested auto freqs = utils::getAllIds(infoCb.selector, IdentifierType::DAB_FREQUENCY); EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq)); } /** * Test tuning with empty program selector. * Loading Loading @@ -516,6 +560,12 @@ TEST_P(BroadcastRadioHalTest, Seek) { EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChanged_, _).Times(AnyNumber()); auto result = mSession->scan(true /* up */, true /* skip subchannel */); if (result == Result::NOT_SUPPORTED) { printSkipped("seek not supported"); return; } EXPECT_EQ(Result::OK, result); EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChanged_, timeout::tune); Loading Loading @@ -565,6 +615,12 @@ TEST_P(BroadcastRadioHalTest, Cancel) { for (int i = 0; i < 10; i++) { auto result = mSession->scan(true /* up */, true /* skip subchannel */); if (result == Result::NOT_SUPPORTED) { printSkipped("cancel is skipped because of seek not supported"); return; } ASSERT_EQ(Result::OK, result); auto cancelResult = mSession->cancel(); Loading camera/common/1.0/default/CameraModule.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -549,7 +549,6 @@ void CameraModule::removeCamera(int cameraId) { } } } free_camera_metadata(metadata); } mCameraInfoMap.removeItem(cameraId); Loading keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -2562,7 +2562,8 @@ TEST_P(EncryptionOperationsTest, RsaPkcs1Success) { string message = "Hello World!"; auto params = AuthorizationSetBuilder().Padding(PaddingMode::RSA_PKCS1_1_5_ENCRYPT); string ciphertext1 = EncryptMessage(message, params); EXPECT_EQ(2048U / 8, ciphertext1.size()); // Die here on failure because we try to modify ciphertext1 below ASSERT_EQ(2048U / 8, ciphertext1.size()) << "Failed to encrypt the message"; string ciphertext2 = EncryptMessage(message, params); EXPECT_EQ(2048U / 8, ciphertext2.size()); Loading Loading
automotive/vehicle/2.0/default/impl/vhal_v2_0/JsonFakeValueGenerator.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -96,11 +96,12 @@ bool JsonFakeValueGenerator::hasNext() { std::vector<VehiclePropValue> JsonFakeValueGenerator::parseFakeValueJson(std::istream& is) { std::vector<VehiclePropValue> fakeVhalEvents; Json::Reader reader; Json::CharReaderBuilder builder; Json::Value rawEvents; if (!reader.parse(is, rawEvents)) { std::string errorMessage; if (!Json::parseFromStream(builder, is, &rawEvents, &errorMessage)) { ALOGE("%s: Failed to parse fake data JSON file. Error: %s", __func__, reader.getFormattedErrorMessages().c_str()); errorMessage.c_str()); return fakeVhalEvents; } Loading
biometrics/common/aidl/OWNERS 0 → 100644 +2 −0 Original line number Diff line number Diff line ilyamaty@google.com kchyn@google.com
broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp +56 −0 Original line number Diff line number Diff line Loading @@ -485,6 +485,50 @@ TEST_P(BroadcastRadioHalTest, TuneFailsWithInvalid) { } } /** * Test tuning with DAB selector. * * Verifies that: * - if DAB selector is not supported, the method returns NOT_SUPPORTED; * - if it is supported, the method succeeds; * - after a successful tune call, onCurrentProgramInfoChanged callback is * invoked carrying a proper selector; * - program changes exactly to what was requested. */ TEST_F(BroadcastRadioHalTest, DabTune) { ASSERT_TRUE(openSession()); ProgramSelector sel = {}; uint64_t freq = 178352; sel.primaryId = make_identifier(IdentifierType::DAB_FREQUENCY,freq); std::this_thread::sleep_for(gTuneWorkaround); // try tuning ProgramInfo infoCb = {}; EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChanged_, InfoHasId(utils::make_identifier(IdentifierType::DAB_FREQUENCY, freq))) .Times(AnyNumber()) .WillOnce(DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(Void())))); auto result = mSession->tune(sel); // expect a failure if it's not supported if (!utils::isSupported(mProperties, sel)) { EXPECT_EQ(Result::NOT_SUPPORTED, result); return; } // expect a callback if it succeeds EXPECT_EQ(Result::OK, result); EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChanged_, timeout::tune); LOG(DEBUG) << "current program info: " << toString(infoCb); // it should tune exactly to what was requested auto freqs = utils::getAllIds(infoCb.selector, IdentifierType::DAB_FREQUENCY); EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq)); } /** * Test tuning with empty program selector. * Loading Loading @@ -516,6 +560,12 @@ TEST_P(BroadcastRadioHalTest, Seek) { EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChanged_, _).Times(AnyNumber()); auto result = mSession->scan(true /* up */, true /* skip subchannel */); if (result == Result::NOT_SUPPORTED) { printSkipped("seek not supported"); return; } EXPECT_EQ(Result::OK, result); EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChanged_, timeout::tune); Loading Loading @@ -565,6 +615,12 @@ TEST_P(BroadcastRadioHalTest, Cancel) { for (int i = 0; i < 10; i++) { auto result = mSession->scan(true /* up */, true /* skip subchannel */); if (result == Result::NOT_SUPPORTED) { printSkipped("cancel is skipped because of seek not supported"); return; } ASSERT_EQ(Result::OK, result); auto cancelResult = mSession->cancel(); Loading
camera/common/1.0/default/CameraModule.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -549,7 +549,6 @@ void CameraModule::removeCamera(int cameraId) { } } } free_camera_metadata(metadata); } mCameraInfoMap.removeItem(cameraId); Loading
keymaster/4.0/vts/functional/keymaster_hidl_hal_test.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -2562,7 +2562,8 @@ TEST_P(EncryptionOperationsTest, RsaPkcs1Success) { string message = "Hello World!"; auto params = AuthorizationSetBuilder().Padding(PaddingMode::RSA_PKCS1_1_5_ENCRYPT); string ciphertext1 = EncryptMessage(message, params); EXPECT_EQ(2048U / 8, ciphertext1.size()); // Die here on failure because we try to modify ciphertext1 below ASSERT_EQ(2048U / 8, ciphertext1.size()) << "Failed to encrypt the message"; string ciphertext2 = EncryptMessage(message, params); EXPECT_EQ(2048U / 8, ciphertext2.size()); Loading