Skip to content

Commit

Permalink
Removed unwanted imports from iOS audio data tests
Browse files Browse the repository at this point in the history
  • Loading branch information
priankakariat committed Oct 9, 2024
1 parent c256990 commit e72a28f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion mediapipe/tasks/ios/test/audio/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ objc_library(
deps = [
"//mediapipe/tasks/ios/audio/core:MPPAudioData",
"//mediapipe/tasks/ios/common:MPPCommon",
"//mediapipe/tasks/ios/common/utils:MPPCommonUtils",
"//mediapipe/tasks/ios/test/audio/core/utils:AVAudioPCMBufferTestUtils",
"//mediapipe/tasks/ios/test/utils:MPPFileInfo",
"//third_party/apple_frameworks:AVFoundation",
Expand Down
7 changes: 1 addition & 6 deletions mediapipe/tasks/ios/test/audio/core/MPPAudioDataTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#import "mediapipe/tasks/ios/audio/core/sources/MPPAudioData.h"
#import "mediapipe/tasks/ios/common/sources/MPPCommon.h"
#import "mediapipe/tasks/ios/common/utils/sources/MPPCommonUtils.h"
#import "mediapipe/tasks/ios/test/audio/core/utils/sources/AVAudioPCMBuffer+TestUtils.h"
#import "mediapipe/tasks/ios/test/utils/sources/MPPFileInfo.h"

Expand Down Expand Up @@ -84,7 +83,7 @@ - (BOOL)isValidAudioRecordFormat:(MPPAudioDataFormat *)format error:(NSError **)
@end

@implementation MPPAudioData (Tests)
// Mocks the logic of `loadAudioRecord` for tests to prevent audio engine running state checks.
// Mocks the logic of `loadAudioRecord` for tests to avoid audio engine running state checks.
- (BOOL)mockLoadAudioRecord:(MPPAudioRecord *)audioRecord error:(NSError **)error {
if (![self isValidAudioRecordFormat:audioRecord.audioDataFormat error:error]) {
return NO;
Expand All @@ -96,10 +95,6 @@ - (BOOL)mockLoadAudioRecord:(MPPAudioRecord *)audioRecord error:(NSError **)erro
withLength:audioRecord.bufferLength
error:error];

// if (!audioRecordBuffer) {
// return NO;
// }

return [self loadRingBufferWithAudioRecordBuffer:audioRecordBuffer error:error];
}
@end
Expand Down

0 comments on commit e72a28f

Please sign in to comment.