diff options
author | Ytai Ben-tsvi <ytai@google.com> | 2021-08-26 17:36:26 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-08-26 17:36:26 +0000 |
commit | c55b9be4b92ce31ec2e7db245239993fd2ef3ebb (patch) | |
tree | 569ee58c188b95f781990bd8b635a98def42e482 /soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp | |
parent | 9a78d09ce543ef6a702d1dd2bf7afa355272e3c5 (diff) | |
parent | 3f1c392d7e3567a42c45c9cc81b8902c45d37cb0 (diff) |
Merge changes from topic "deprecate-sthal-2.4"
* changes:
Remove STHAL 2.4
Create a soundtrigger v2.3 CLI mock
Diffstat (limited to 'soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp')
-rw-r--r-- | soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp b/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp deleted file mode 100644 index 13d70058e1..0000000000 --- a/soundtrigger/2.4/vts/functional/VtsHalSoundtriggerV2_4TargetTest.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "SoundTriggerHidlHalTest" - -#include <android-base/logging.h> -#include <android/hardware/audio/common/2.0/types.h> -#include <android/hardware/soundtrigger/2.4/ISoundTriggerHwGlobalCallback.h> -#include <android/hardware/soundtrigger/2.4/ISoundTriggerHw.h> -#include <gtest/gtest.h> -#include <hidl/GtestPrinter.h> -#include <hidl/ServiceManagement.h> - -using ::android::sp; -using ::android::hardware::Return; -using ::android::hardware::Status; -using ::android::hardware::soundtrigger::V2_4::ISoundTriggerHw; -using ::android::hardware::soundtrigger::V2_4::ISoundTriggerHwGlobalCallback; - -/** - * Test class holding the instance of the SoundTriggerHW service to test. - * The passed parameter is the registered name of the implementing service - * supplied by INSTANTIATE_TEST_SUITE_P() call. - */ -class SoundTriggerHidlTest : public testing::TestWithParam<std::string> { -public: - void SetUp() override { - mSoundtrigger = ISoundTriggerHw::getService(GetParam()); - - ASSERT_NE(mSoundtrigger, nullptr); - LOG(INFO) << "Test is remote " << mSoundtrigger->isRemote(); - } - -protected: - sp<ISoundTriggerHw> mSoundtrigger; -}; - -/** - * Empty test is in place to ensure service is initialized. - * Due to the nature of SoundTrigger HAL providing an interface for - * proprietary or vendor specific implementations, limited testing on - * individual APIs is possible. - */ -TEST_P(SoundTriggerHidlTest, ServiceIsInstantiated) {} - -class GlobalCallback : public ISoundTriggerHwGlobalCallback { - Return<void> onResourcesAvailable() override { - return Status::ok(); - } -}; - -/** - * Test ISoundTriggerHw::registerGlobalCallback method - * - * Verifies that: - * - the implementation implements the method - * - the method returns no error - */ -TEST_P(SoundTriggerHidlTest, RegisterGlobalCallback) { - Return<void> hidlReturn; - sp<ISoundTriggerHwGlobalCallback> callback = new GlobalCallback(); - hidlReturn = mSoundtrigger->registerGlobalCallback(callback); - EXPECT_TRUE(hidlReturn.isOk()); -} - -GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SoundTriggerHidlTest); - -INSTANTIATE_TEST_SUITE_P( - PerInstance, SoundTriggerHidlTest, - testing::ValuesIn(android::hardware::getAllHalInstanceNames(ISoundTriggerHw::descriptor)), - android::hardware::PrintInstanceNameToString); |