Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0 tests #40

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,19 @@ class KoalaDemoUITests: XCTestCase {
XCTAssert("\(error.localizedDescription)".count == first_error.count)
}
}

func testProcessMessageStack() throws {
let k = try Koala.init(accessKey: accessKey)
k.delete()

var testPcm: [Int16] = []
testPcm.reserveCapacity(Int(Koala.frameLength))

do {
let res = try k.process(testPcm)
XCTAssert(res.count == 0)
} catch {
XCTAssert("\(error.localizedDescription)".count > 0)
}
}
}
6 changes: 3 additions & 3 deletions binding/ios/KoalaAppTest/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'

target 'KoalaAppTest' do
pod 'Koala-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/koala/v2.0-ios/binding/ios/Koala-iOS.podspec'
pod 'Koala-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/koala/v2.0/binding/ios/Koala-iOS.podspec'
end

target 'KoalaAppTestUITests' do
pod 'Koala-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/koala/v2.0-ios/binding/ios/Koala-iOS.podspec'
pod 'Koala-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/koala/v2.0/binding/ios/Koala-iOS.podspec'
end

target 'PerformanceTest' do
pod 'Koala-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/koala/v2.0-ios/binding/ios/Koala-iOS.podspec'
pod 'Koala-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/koala/v2.0/binding/ios/Koala-iOS.podspec'
end
8 changes: 4 additions & 4 deletions binding/ios/KoalaAppTest/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ PODS:
- Koala-iOS (2.0.0)

DEPENDENCIES:
- Koala-iOS (from `https://raw.githubusercontent.com/Picovoice/koala/v2.0-ios/binding/ios/Koala-iOS.podspec`)
- Koala-iOS (from `https://raw.githubusercontent.com/Picovoice/koala/v2.0/binding/ios/Koala-iOS.podspec`)

EXTERNAL SOURCES:
Koala-iOS:
:podspec: https://raw.githubusercontent.com/Picovoice/koala/v2.0-ios/binding/ios/Koala-iOS.podspec
:podspec: https://raw.githubusercontent.com/Picovoice/koala/v2.0/binding/ios/Koala-iOS.podspec

CHECKOUT OPTIONS:
Koala-iOS:
:commit: 82b588b19cb7225222853f7709f9e5de20415b47
:git: https://github.com/Picovoice/koala.git

SPEC CHECKSUMS:
Koala-iOS: 865994d8e18b03854f2b933ec9645915ba95f189
Koala-iOS: c5190ec400b672d5a363593e224732bdb7cd3afb

PODFILE CHECKSUM: aa02120478c1d3dd9e8085db3379479143edbc02
PODFILE CHECKSUM: 41b47c56686d6916c5128d756c487b9b3f25767c

COCOAPODS: 1.11.3
22 changes: 22 additions & 0 deletions binding/python/test_koala.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,28 @@ def test_message_stack(self):
self.assertEqual(len(error), len(e.message_stack))
self.assertListEqual(list(error), list(e.message_stack))

def test_process_message_stack(self):
relative_path = '../..'

k = Koala(
access_key=self.access_key,
model_path=default_model_path(relative_path),
library_path=default_library_path(relative_path))

test_pcm = [0] * k.frame_length

address = k._handle
k._handle = None

try:
res = k.process(test_pcm)
self.assertEqual(len(res), 0)
except KoalaError as e:
self.assertGreater(len(e.message_stack), 0)
self.assertLess(len(e.message_stack), 8)

k._handle = address


if __name__ == '__main__':
parser = argparse.ArgumentParser()
Expand Down
2 changes: 1 addition & 1 deletion demo/ios/KoalaDemo/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'

target 'KoalaDemo' do
pod 'Koala-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/koala/v2.0-ios/binding/ios/Koala-iOS.podspec'
pod 'Koala-iOS', :podspec => 'https://raw.githubusercontent.com/Picovoice/koala/v2.0/binding/ios/Koala-iOS.podspec'
pod 'ios-voice-processor', '~> 1.1.0'
end
8 changes: 4 additions & 4 deletions demo/ios/KoalaDemo/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ PODS:

DEPENDENCIES:
- ios-voice-processor (~> 1.1.0)
- Koala-iOS (from `https://raw.githubusercontent.com/Picovoice/koala/v2.0-ios/binding/ios/Koala-iOS.podspec`)
- Koala-iOS (from `https://raw.githubusercontent.com/Picovoice/koala/v2.0/binding/ios/Koala-iOS.podspec`)

SPEC REPOS:
trunk:
- ios-voice-processor

EXTERNAL SOURCES:
Koala-iOS:
:podspec: https://raw.githubusercontent.com/Picovoice/koala/v2.0-ios/binding/ios/Koala-iOS.podspec
:podspec: https://raw.githubusercontent.com/Picovoice/koala/v2.0/binding/ios/Koala-iOS.podspec

CHECKOUT OPTIONS:
Koala-iOS:
Expand All @@ -21,8 +21,8 @@ CHECKOUT OPTIONS:

SPEC CHECKSUMS:
ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1
Koala-iOS: 865994d8e18b03854f2b933ec9645915ba95f189
Koala-iOS: c5190ec400b672d5a363593e224732bdb7cd3afb

PODFILE CHECKSUM: 0f89a64b9647d42bf16b4915aa88de8d933489b8
PODFILE CHECKSUM: 65beadb4e5a0c4d4e33a9c747318d401315106c2

COCOAPODS: 1.11.3