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

Commit 6a56e38e authored by Yifan Hong's avatar Yifan Hong
Browse files

Moved operator== to be autogen'd by hidl-gen.

Test: audio_effect_hidl_hal_test
Bug: 32834072
Change-Id: I58e8eb6ed85f8f1adce8c9334f7934146174e981
parent a13ec5a8
Loading
Loading
Loading
Loading
+0 −43
Original line number Diff line number Diff line
@@ -97,49 +97,6 @@ TEST_F(AudioEffectHidlTest, CreateEffect) {
  EXPECT_NE(effect, nullptr);
}

// See b/32834072 -- we should have those operator== generated by hidl-gen.

namespace android {
namespace hardware {
namespace audio {
namespace common {
namespace V2_0 {

static bool operator==(const Uuid& lhs, const Uuid& rhs) {
  return lhs.timeLow == rhs.timeLow && lhs.timeMid == rhs.timeMid &&
         lhs.versionAndTimeHigh == rhs.versionAndTimeHigh &&
         lhs.variantAndClockSeqHigh == rhs.variantAndClockSeqHigh &&
         memcmp(lhs.node.data(), rhs.node.data(), lhs.node.size()) == 0;
}

}  // namespace V2_0
}  // namespace common
}  // namespace audio
}  // namespace hardware
}  // namespace android

namespace android {
namespace hardware {
namespace audio {
namespace effect {
namespace V2_0 {

static bool operator==(const EffectDescriptor& lhs,
                       const EffectDescriptor& rhs) {
  return lhs.type == rhs.type && lhs.uuid == rhs.uuid &&
         lhs.flags == rhs.flags && lhs.cpuLoad == rhs.cpuLoad &&
         lhs.memoryUsage == rhs.memoryUsage &&
         memcmp(lhs.name.data(), rhs.name.data(), lhs.name.size()) == 0 &&
         memcmp(lhs.implementor.data(), rhs.implementor.data(),
                lhs.implementor.size()) == 0;
}

}  // namespace V2_0
}  // namespace effect
}  // namespace audio
}  // namespace hardware
}  // namespace android

TEST_F(AudioEffectHidlTest, GetDescriptor) {
  hidl_vec<EffectDescriptor> allDescriptors;
  Return<void> ret = effectsFactory->getAllDescriptors(