diff --git a/services/audio_engine/node/include/hpae_sink_input_node.h b/services/audio_engine/node/include/hpae_sink_input_node.h index 3c6f5eff28de761cc3d5354f3a5e6743e703eba0..27eea3136db1a9fb87b90ba355a60de9b1f0b8df 100644 --- a/services/audio_engine/node/include/hpae_sink_input_node.h +++ b/services/audio_engine/node/include/hpae_sink_input_node.h @@ -43,10 +43,9 @@ public: bool Drain(); int32_t SetState(HpaeSessionState renderState); HpaeSessionState GetState(); - uint64_t GetFramesWritten(); int32_t GetCurrentPosition(uint64_t &framePosition, std::vector ×tamp); - int32_t RewindHistoryBuffer(uint64_t rewindTime, uint64_t hdiFramePosition = 0); + void RewindHistoryBuffer(uint64_t rewindTime, uint64_t hdiFramePosition = 0); void SetAppUid(int32_t appUid); int32_t GetAppUid(); @@ -57,9 +56,11 @@ public: float GetLoudnessGain(); void SetSpeed(float speed); float GetSpeed(); + uint64_t GetLatency(); bool isConnected_ = false; private: int32_t GetDataFromSharedBuffer(); + int32_t OnStreamInfoChange(bool needata = true); void CheckAndDestroyHistoryBuffer(); bool ReadToAudioBuffer(int32_t &ret); std::weak_ptr writeCallback_; @@ -70,7 +71,6 @@ private: HpaePcmBuffer emptyAudioBuffer_; OutputPort outputStream_; std::vector interleveData_; - uint64_t framesWritten_; uint64_t totalFrames_; bool isDrain_ = false; HpaeSessionState state_ = HPAE_SESSION_NEW; diff --git a/services/audio_engine/node/src/hpae_offload_sinkoutput_node.cpp b/services/audio_engine/node/src/hpae_offload_sinkoutput_node.cpp index 3ff703473061f81be8ef2363e4b6afc1a1c00150..c6e3eac6da9d13c3d4d29b2e7592b745662d5a51 100644 --- a/services/audio_engine/node/src/hpae_offload_sinkoutput_node.cpp +++ b/services/audio_engine/node/src/hpae_offload_sinkoutput_node.cpp @@ -354,8 +354,8 @@ void HpaeOffloadSinkOutputNode::StopStream() AUDIO_DEBUG_LOG("OffloadRewindAndFlush rewind time in us %{public}" PRIu64, rewindTime); auto callback = GetNodeInfo().statusCallback.lock(); CHECK_AND_RETURN_LOG(callback != nullptr, "HpaeOffloadSinkOutputNode::StopStream callback is null"); - callback->OnRewindAndFlush(rewindTime, hdiRealPos_); OffloadReset(); + callback->OnRewindAndFlush(rewindTime, hdiRealPos_); } void HpaeOffloadSinkOutputNode::SetPolicyState(int32_t state) diff --git a/services/audio_engine/node/src/hpae_sink_input_node.cpp b/services/audio_engine/node/src/hpae_sink_input_node.cpp index 0a5e58988178c84513810927e7fc92d5e035b227..67af1fe9712d1eae7c3dd184db94693912d7be4a 100644 --- a/services/audio_engine/node/src/hpae_sink_input_node.cpp +++ b/services/audio_engine/node/src/hpae_sink_input_node.cpp @@ -35,6 +35,8 @@ const std::string DEVICE_CLASS_REMOTE_OFFLOAD = "remote_offload"; static constexpr uint32_t CUSTOM_SAMPLE_RATE_MULTIPLES = 50; static constexpr uint32_t FRAME_LEN_100MS = 100; static constexpr uint32_t FRAME_LEN_20MS = 20; +constexpr int32_t STANDBY_THRESHOLD = 9; // 9 standby is about 40ms + HpaeSinkInputNode::HpaeSinkInputNode(HpaeNodeInfo &nodeInfo) : HpaeNode(nodeInfo), pcmBufferInfo_(nodeInfo.channels, nodeInfo.frameLen, nodeInfo.customSampleRate == 0 ? nodeInfo.samplingRate : @@ -42,7 +44,7 @@ HpaeSinkInputNode::HpaeSinkInputNode(HpaeNodeInfo &nodeInfo) emptyBufferInfo_(nodeInfo.channels, 0, nodeInfo.customSampleRate == 0 ? nodeInfo.samplingRate : nodeInfo.customSampleRate, (uint64_t)nodeInfo.channelLayout), inputAudioBuffer_(pcmBufferInfo_), emptyAudioBuffer_(emptyBufferInfo_), outputStream_(this), - interleveData_(nodeInfo.frameLen * nodeInfo.channels * GetSizeFromFormat(nodeInfo.format)), framesWritten_(0), + interleveData_(nodeInfo.frameLen * nodeInfo.channels * GetSizeFromFormat(nodeInfo.format)), totalFrames_(0) { AUDIO_INFO_LOG("sinkinput sessionId %{public}d, channelcount %{public}d, channelLayout %{public}" PRIu64 ", " @@ -99,31 +101,12 @@ void HpaeSinkInputNode::CheckAndDestroyHistoryBuffer() int32_t HpaeSinkInputNode::GetDataFromSharedBuffer() { - streamInfo_ = {.hdiFramePosition = hdiFramePosition_.exchange(0), - .framesWritten = framesWritten_, - .latency = streamInfo_.latency, - .inputData = interleveData_.data(), - .requestDataLen = interleveData_.size(), - .deviceClass = GetDeviceClass(), - .deviceNetId = GetDeviceNetId(), - .needData = !(historyBuffer_ && historyBuffer_->GetCurFrames()), - // offload enbale, underrun 9 times, request force write data; 9 times about 40ms - .forceData = offloadEnable_ ? (standbyCounter_ > 9 ? true : false) : true}; - GetCurrentPosition(streamInfo_.framePosition, streamInfo_.timestamp); - auto writeCallback = writeCallback_.lock(); - if (writeCallback != nullptr) { - return writeCallback->OnStreamData(streamInfo_); - } - AUDIO_ERR_LOG("sessionId: %{public}d, writeCallback is nullptr", GetSessionId()); - return ERROR; + return OnStreamInfoChange(true); } bool HpaeSinkInputNode::ReadToAudioBuffer(int32_t &ret) { auto nodeCallback = GetNodeStatusCallback().lock(); - if (nodeCallback) { - nodeCallback->OnRequestLatency(GetSessionId(), streamInfo_.latency); - } if ((GetDeviceClass() == DEVICE_CLASS_OFFLOAD || GetDeviceClass() == DEVICE_CLASS_REMOTE_OFFLOAD) && !offloadEnable_) { ret = ERR_OPERATION_FAILED; @@ -200,8 +183,7 @@ void HpaeSinkInputNode::DoProcess() AudioPerformanceMonitor::GetInstance().RecordSilenceState(GetSessionId(), false, pipeType, static_cast(appUid_)); } - totalFrames_ = totalFrames_ + GetFrameLen(); - framesWritten_ = totalFrames_; + totalFrames_ += GetFrameLen(); if (historyBuffer_) { historyBuffer_->StoreFrameData(inputAudioBuffer_); } @@ -281,29 +263,13 @@ int32_t HpaeSinkInputNode::GetAppUid() return appUid_; } -uint64_t HpaeSinkInputNode::GetFramesWritten() -{ - return framesWritten_; -} - -int32_t HpaeSinkInputNode::GetCurrentPosition(uint64_t &framePosition, std::vector ×tamp) +void HpaeSinkInputNode::RewindHistoryBuffer(uint64_t rewindTime, uint64_t hdiFramePosition) { - framePosition = GetFramesWritten(); - if (historyBuffer_) { - framePosition = framePosition > historyBuffer_->GetCurFrames() * GetFrameLen() - ? framePosition - historyBuffer_->GetCurFrames() * GetFrameLen() - : 0; - } - ClockTime::GetAllTimeStamp(timestamp); - return SUCCESS; -} - -int32_t HpaeSinkInputNode::RewindHistoryBuffer(uint64_t rewindTime, uint64_t hdiFramePosition) -{ - CHECK_AND_RETURN_RET_LOG(historyBuffer_, ERROR, "historyBuffer_ is nullptr"); + CHECK_AND_RETURN_LOG(historyBuffer_, "historyBuffer_ is nullptr"); hdiFramePosition_.store(hdiFramePosition); AUDIO_INFO_LOG("HpaeSinkInputNode::rewind %{public}zu frames", ConvertUsToFrameCount(rewindTime, GetNodeInfo())); - return historyBuffer_->RewindBuffer(ConvertUsToFrameCount(rewindTime, GetNodeInfo())); + historyBuffer_->RewindBuffer(ConvertUsToFrameCount(rewindTime, GetNodeInfo())); + OnStreamInfoChange(false); } void HpaeSinkInputNode::SetOffloadEnabled(bool offloadEnable) @@ -336,6 +302,40 @@ float HpaeSinkInputNode::GetSpeed() { return speed_; } + +uint64_t HpaeSinkInputNode::GetLatency() +{ + return historyBuffer_ ? historyBuffer_->GetCurFrames() * GetFrameLen() : 0; +} + +int32_t HpaeSinkInputNode::OnStreamInfoChange(bool isPullData) +{ + auto writeCallback = writeCallback_.lock(); + CHECK_AND_RETURN_RET_LOG(writeCallback, ERROR, "writeCallback is null, Id: %{public}d fatal err", GetSessionId()); + bool needData = !(historyBuffer_ && historyBuffer_->GetCurFrames()) && isPullData; + // offload enbale, underrun 9 times, request force write data; 9 times about 40ms + bool forceData = offloadEnable_ ? (standbyCounter_ > STANDBY_THRESHOLD ? true : false) : true; + uint64_t latency = 0; + auto nodeCallback = GetNodeStatusCallback().lock(); + if (nodeCallback) { + nodeCallback->OnRequestLatency(GetSessionId(), latency); + } + latency += GetLatency(); + streamInfo_ = { + .framePosition = totalFrames_, + .hdiFramePosition = hdiFramePosition_.exchange(0), + .framesWritten = totalFrames_, + .latency = latency, + .inputData = interleveData_.data(), + .requestDataLen = interleveData_.size(), + .deviceClass = GetDeviceClass(), + .deviceNetId = GetDeviceNetId(), + .needData = needData, + .forceData = forceData + }; + ClockTime::GetAllTimeStamp(streamInfo_.timestamp); + return writeCallback->OnStreamData(streamInfo_); +} } // namespace HPAE } // namespace AudioStandard } // namespace OHOS \ No newline at end of file diff --git a/services/audio_engine/test/unittest/common/hpae_mocks.h b/services/audio_engine/test/unittest/common/hpae_mocks.h index 8a3a63dc2969c4000b75fc3fb8f36d26e165d33d..63771b5c6d2675e1e92f16c3316db3cea5314d24 100644 --- a/services/audio_engine/test/unittest/common/hpae_mocks.h +++ b/services/audio_engine/test/unittest/common/hpae_mocks.h @@ -19,6 +19,7 @@ #include "gmock/gmock.h" #include "hpae_msg_channel.h" #include "sink/i_audio_render_sink.h" +#include "i_renderer_stream.h" namespace OHOS { namespace AudioStandard { @@ -33,6 +34,8 @@ public: class MockAudioRenderSink : public IAudioRenderSink { public: + MockAudioRenderSink() = default; + virtual ~MockAudioRenderSink() = default; MOCK_METHOD(int32_t, Init, (const IAudioSinkAttr &attr), (override)); MOCK_METHOD(void, DeInit, (), (override)); MOCK_METHOD(bool, IsInited, (), (override)); @@ -112,6 +115,29 @@ public: MOCK_METHOD(void, DumpInfo, (std::string &dumpString), (override)); }; + +// Mock INodeCallback +class MockNodeCallback : public INodeCallback { +public: + MockNodeCallback() = default; + virtual ~MockNodeCallback() = default; + MOCK_METHOD(void, OnNodeStatusUpdate, (uint32_t, IOperation), (override)); + MOCK_METHOD(void, OnFadeDone, (uint32_t, IOperation), (override)); + MOCK_METHOD(void, OnRequestLatency, (uint32_t, uint64_t &), (override)); + MOCK_METHOD(void, OnRewindAndFlush, (uint64_t, uint64_t), (override)); + MOCK_METHOD(void, OnNotifyQueue, (), (override)); + MOCK_METHOD(void, OnDisConnectProcessCluster, (HpaeProcessorType), (override)); + MOCK_METHOD(void, OnNotifyDfxNodeInfo, (bool, uint32_t, HpaeDfxNodeInfo &), (override)); + MOCK_METHOD(void, OnNotifyDfxNodeInfoChanged, (uint32_t, const HpaeDfxNodeInfo &), (override)); +}; + +// Mock IStreamCallback +class MockStreamCallback : public IStreamCallback { +public: + MockStreamCallback() = default; + virtual ~MockStreamCallback() = default; + MOCK_METHOD(int32_t, OnStreamData, (AudioCallBackStreamInfo&), (override)); +}; } // namespace HPAE } // namespace AudioStandard } // namespace OHOS diff --git a/services/audio_engine/test/unittest/node/hpae_sink_input_node_test.cpp b/services/audio_engine/test/unittest/node/hpae_sink_input_node_test.cpp index acbc8a0b818b22e9aae5c5b3e00175d47165ce67..ee742e40a583c9a46b9747125072020e4c1436b3 100644 --- a/services/audio_engine/test/unittest/node/hpae_sink_input_node_test.cpp +++ b/services/audio_engine/test/unittest/node/hpae_sink_input_node_test.cpp @@ -13,38 +13,73 @@ * limitations under the License. */ -#include #include #include +#include "hpae_mocks.h" #include "hpae_sink_input_node.h" #include "hpae_sink_output_node.h" #include "test_case_common.h" #include "audio_errors.h" -using namespace OHOS; -using namespace AudioStandard; -using namespace HPAE; using namespace testing::ext; using namespace testing; +namespace OHOS { +namespace AudioStandard { +namespace HPAE { +constexpr int32_t NORMAL_FRAME_LEN = 960; +constexpr int32_t NORMAL_ID = 1243; +constexpr float LOUDNESS_GAIN = 1.0f; +constexpr uint32_t SAMPLE_RATE_16010 = 16010; +constexpr size_t DEFAULT_HISTROY_FRAME_COUNT = 5; + +static void AddFrameToBuffer(std::unique_ptr &buffer) +{ + CHECK_AND_RETURN(buffer); + PcmBufferInfo info = buffer->pcmBufferInfo_; + info.isMultiFrames = false; + info.frames = 1; + HpaePcmBuffer d{info}; + buffer->PushFrameData(d); +} + +static void PrepareNodeInfo(HpaeNodeInfo &nodeInfo) +{ + nodeInfo.frameLen = NORMAL_FRAME_LEN; + nodeInfo.samplingRate = SAMPLE_RATE_48000; + nodeInfo.channels = STEREO; + nodeInfo.format = SAMPLE_F32LE; + nodeInfo.deviceClass = "primary"; + nodeInfo.deviceNetId = "local"; + nodeInfo.historyFrameCount = DEFAULT_HISTROY_FRAME_COUNT; +} + class HpaeSinkInputNodeTest : public testing::Test { public: - void SetUp(); - void TearDown(); -}; - -void HpaeSinkInputNodeTest::SetUp() -{} + void SetUp() override + { + HpaeNodeInfo nodeInfo; + PrepareNodeInfo(nodeInfo); + node_ = std::make_unique(nodeInfo); + mockNodeCallback_ = std::make_shared(); + mockStreamCallback_ = std::make_shared(); -void HpaeSinkInputNodeTest::TearDown() -{} + // Set up weak pointers for callbacks + node_->nodeInfo_.statusCallback = mockNodeCallback_; + node_->writeCallback_ = mockStreamCallback_; + } -namespace { -constexpr int32_t NORMAL_FRAME_LEN = 960; -constexpr int32_t NORMAL_ID = 1243; + void TearDown() override + { + node_.reset(); + mockNodeCallback_.reset(); + mockStreamCallback_.reset(); + } -constexpr float LOUDNESS_GAIN = 1.0f; -constexpr uint32_t SAMPLE_RATE_16010 = 16010; + std::unique_ptr node_; + std::shared_ptr mockNodeCallback_; + std::shared_ptr mockStreamCallback_; +}; HWTEST_F(HpaeSinkInputNodeTest, constructHpaeSinkInputNode, TestSize.Level0) { @@ -285,4 +320,178 @@ HWTEST_F(HpaeSinkInputNodeTest, testReadToAudioBuffer, TestSize.Level0) funcRet = sinkInputNode->ReadToAudioBuffer(ret); EXPECT_EQ(funcRet, true); } -} \ No newline at end of file + +// Test case when nodeCallback is null +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_NodeCallbackNull_LatencyZero, TestSize.Level0) { + node_->nodeInfo_.statusCallback.reset(); + + EXPECT_CALL(*mockStreamCallback_, OnStreamData(_)) + .WillOnce([&](AudioCallBackStreamInfo& info) { + EXPECT_EQ(info.latency, 0); // no latency + return SUCCESS; + }); + + int32_t result = node_->OnStreamInfoChange(true); + EXPECT_EQ(result, SUCCESS); +} + +// Test case when writeCallback is null +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_WriteCallbackNull_ReturnsError, TestSize.Level0) { + node_->writeCallback_.reset(); + + int32_t result = node_->OnStreamInfoChange(true); + EXPECT_EQ(result, ERROR); +} + +// Test case when needData is true (historyBuffer is null and isPullData is true) +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_NeedDataTrue, TestSize.Level0) { + node_->historyBuffer_ = nullptr; + + EXPECT_CALL(*mockNodeCallback_, OnRequestLatency(_, _)).WillOnce(SetArgReferee<1>(5)); + + // Verify that needData is true and forceData is true (offloadEnable_ is false by default) + EXPECT_CALL(*mockStreamCallback_, OnStreamData(_)) + .WillOnce([&](AudioCallBackStreamInfo& info) { + EXPECT_TRUE(info.needData); + EXPECT_TRUE(info.forceData); + return SUCCESS; + }); + + int32_t result = node_->OnStreamInfoChange(true); + EXPECT_EQ(result, SUCCESS); +} + +// Test case when needData is false (historyBuffer has data) +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_NeedDataFalse, TestSize.Level0) { + AddFrameToBuffer(node_->historyBuffer_); + + EXPECT_CALL(*mockNodeCallback_, OnRequestLatency(_, _)).WillOnce(SetArgReferee<1>(5)); + + // Verify that needData is false and forceData is true (offloadEnable_ is false by default) + EXPECT_CALL(*mockStreamCallback_, OnStreamData(_)) + .WillOnce([&](AudioCallBackStreamInfo& info) { + EXPECT_FALSE(info.needData); + EXPECT_TRUE(info.forceData); + return SUCCESS; + }); + + int32_t result = node_->OnStreamInfoChange(true); + EXPECT_EQ(result, SUCCESS); +} + +// Test case when forceData is true (offloadEnable is false) +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_ForceDataTrue_OffloadDisabled, TestSize.Level0) { + node_->historyBuffer_ = nullptr; + node_->offloadEnable_ = false; + + EXPECT_CALL(*mockNodeCallback_, OnRequestLatency(_, _)).WillOnce(SetArgReferee<1>(5)); + + // Verify that needData is true and forceData is true + EXPECT_CALL(*mockStreamCallback_, OnStreamData(_)) + .WillOnce([&](AudioCallBackStreamInfo& info) { + EXPECT_TRUE(info.needData); + EXPECT_TRUE(info.forceData); + return SUCCESS; + }); + + int32_t result = node_->OnStreamInfoChange(true); + EXPECT_EQ(result, SUCCESS); +} + +// Test case when forceData is true (offloadEnable is true and standbyCounter exceeds threshold) +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_ForceDataTrue_StandbyExceedThreshold, TestSize.Level0) { + node_->historyBuffer_ = nullptr; + node_->offloadEnable_ = true; + node_->standbyCounter_ = 10; // Exceeds STANDBY_THRESHOLD (9) + + EXPECT_CALL(*mockNodeCallback_, OnRequestLatency(_, _)).WillOnce(SetArgReferee<1>(5)); + + // Verify that needData is true and forceData is true + EXPECT_CALL(*mockStreamCallback_, OnStreamData(_)) + .WillOnce([&](AudioCallBackStreamInfo& info) { + EXPECT_TRUE(info.needData); + EXPECT_TRUE(info.forceData); + return SUCCESS; + }); + + int32_t result = node_->OnStreamInfoChange(true); + EXPECT_EQ(result, SUCCESS); +} + +// Test case when forceData is false (offloadEnable is true and standbyCounter is below threshold) +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_ForceDataFalse_StandbyBelowThreshold, TestSize.Level0) { + node_->historyBuffer_ = nullptr; + node_->offloadEnable_ = true; + node_->standbyCounter_ = 5; // Below STANDBY_THRESHOLD (9) + + EXPECT_CALL(*mockNodeCallback_, OnRequestLatency(_, _)).WillOnce(SetArgReferee<1>(5)); + + // Verify that needData is true and forceData is false + EXPECT_CALL(*mockStreamCallback_, OnStreamData(_)) + .WillOnce([&](AudioCallBackStreamInfo& info) { + EXPECT_TRUE(info.needData); + EXPECT_FALSE(info.forceData); + return SUCCESS; + }); + + int32_t result = node_->OnStreamInfoChange(true); + EXPECT_EQ(result, SUCCESS); +} + +// Test case to verify parameters passed to OnStreamData are correct +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_StreamDataParametersCorrect, TestSize.Level0) { + node_->historyBuffer_ = nullptr; + + EXPECT_CALL(*mockNodeCallback_, OnRequestLatency(_, _)).WillOnce(SetArgReferee<1>(5)); + + AudioCallBackStreamInfo expectedInfo; + expectedInfo.framePosition = node_->totalFrames_; + expectedInfo.hdiFramePosition = 0; // Because of hdiFramePosition_.exchange(0) + expectedInfo.framesWritten = node_->totalFrames_; + expectedInfo.latency = 5; // OnRequestLatency returns 5 + GetLatency(0) returns 5 + expectedInfo.inputData = node_->interleveData_.data(); + expectedInfo.requestDataLen = node_->interleveData_.size(); + expectedInfo.deviceClass = "primary"; + expectedInfo.deviceNetId = "local"; + expectedInfo.needData = true; + expectedInfo.forceData = true; // Because offloadEnable_ is false by default + + EXPECT_CALL(*mockStreamCallback_, OnStreamData(_)) + .WillOnce([&](AudioCallBackStreamInfo& info) { + EXPECT_EQ(info.framePosition, expectedInfo.framePosition); + EXPECT_EQ(info.hdiFramePosition, expectedInfo.hdiFramePosition); + EXPECT_EQ(info.framesWritten, expectedInfo.framesWritten); + EXPECT_EQ(info.latency, expectedInfo.latency); + EXPECT_EQ(info.inputData, expectedInfo.inputData); + EXPECT_EQ(info.requestDataLen, expectedInfo.requestDataLen); + EXPECT_EQ(info.deviceClass, expectedInfo.deviceClass); + EXPECT_EQ(info.deviceNetId, expectedInfo.deviceNetId); + EXPECT_EQ(info.needData, expectedInfo.needData); + EXPECT_EQ(info.forceData, expectedInfo.forceData); + return SUCCESS; + }); + + int32_t result = node_->OnStreamInfoChange(true); + EXPECT_EQ(result, SUCCESS); +} + +// Test case when isPullData is false and historyBuffer is null +HWTEST_F(HpaeSinkInputNodeTest, OnStreamInfoChange_IsPullDataFalse, TestSize.Level0) { + node_->historyBuffer_ = nullptr; + + EXPECT_CALL(*mockNodeCallback_, OnRequestLatency(_, _)).WillOnce(SetArgReferee<1>(5)); + + // Verify that needData is false (because isPullData is false) and forceData is true + EXPECT_CALL(*mockStreamCallback_, OnStreamData(_)) + .WillOnce([&](AudioCallBackStreamInfo& info) { + EXPECT_FALSE(info.needData); + EXPECT_TRUE(info.forceData); // offloadEnable_ is false by default + return SUCCESS; + }); + + int32_t result = node_->OnStreamInfoChange(false); + EXPECT_EQ(result, SUCCESS); +} +} // namespace HPAE +} // namespace AudioStandard +} // namespace OHOS \ No newline at end of file diff --git a/test/fuzztest/hpaesinkinputnode_fuzzer/hpaesinkinputnode_fuzzer.cpp b/test/fuzztest/hpaesinkinputnode_fuzzer/hpaesinkinputnode_fuzzer.cpp index aaea8490285d4782e0121b0ecd21b4a44e4c2ea4..87423cd0b473c5d24b8f2e6d014b69ce4c96327b 100644 --- a/test/fuzztest/hpaesinkinputnode_fuzzer/hpaesinkinputnode_fuzzer.cpp +++ b/test/fuzztest/hpaesinkinputnode_fuzzer/hpaesinkinputnode_fuzzer.cpp @@ -139,22 +139,6 @@ void GetStateFuzzTest() hpaeSinkInputNode->GetState(); } -void GetFramesWrittenFuzzTest() -{ - HpaeNodeInfo nodeInfo; - auto hpaeSinkInputNode = std::make_shared(nodeInfo); - hpaeSinkInputNode->GetFramesWritten(); -} - -void GetCurrentPositionFuzzTest() -{ - HpaeNodeInfo nodeInfo; - auto hpaeSinkInputNode = std::make_shared(nodeInfo); - uint64_t framePosition = GetData(); - std::vector timestamp; - hpaeSinkInputNode->GetCurrentPosition(framePosition, timestamp); -} - void RewindHistoryBufferFuzzTest() { HpaeNodeInfo nodeInfo; @@ -218,8 +202,6 @@ TestFuncs g_testFuncs = { DrainFuzzTest, SetStateFuzzTest, GetStateFuzzTest, - GetFramesWrittenFuzzTest, - GetCurrentPositionFuzzTest, RewindHistoryBufferFuzzTest, SetAppUidFuzzTest, GetAppUidFuzzTest,