diff --git a/binding/go/porcupine_test.go b/binding/go/porcupine_test.go index 65aa55cee..c9b5877f1 100644 --- a/binding/go/porcupine_test.go +++ b/binding/go/porcupine_test.go @@ -326,19 +326,10 @@ func TestProcessMessageStack(t *testing.T) { porcupine.handle = nil testPcm := make([]int16, FrameLength) - ret, _ := nativePorcupine.nativeProcess(&porcupine, testPcm) - if ret != SUCCESS { - errorStatus, messageStack := nativePorcupine.nativeGetErrorStack() - if errorStatus != SUCCESS { - t.Fatalf("Unable to get Porcupine error state") - } - - if len(messageStack) == 0 || len(messageStack) > 8 { - t.Fatalf("Invalid message stack length %d", len(messageStack)) - } - } else { - t.Fatalf("Expected process to fail") - } - + + _, err = porcupine.Process(testPcm) porcupine.handle = address + if err == nil { + t.Fatalf("Expected porcupine process to fail") + } } diff --git a/binding/ios/PorcupineAppTest/PorcupineAppTestUITests/PorcupineAppTestUITests.swift b/binding/ios/PorcupineAppTest/PorcupineAppTestUITests/PorcupineAppTestUITests.swift index 9a9a9e695..5caae7f86 100644 --- a/binding/ios/PorcupineAppTest/PorcupineAppTestUITests/PorcupineAppTestUITests.swift +++ b/binding/ios/PorcupineAppTest/PorcupineAppTestUITests/PorcupineAppTestUITests.swift @@ -263,4 +263,19 @@ class PorcupineAppTestUITests: BaseTest { XCTAssert("\(error.localizedDescription)".count == first_error.count) } } + + func testProcessMessageStack() throws { + let p = try Porcupine.init(accessKey: accessKey, keyword: Porcupine.BuiltInKeyword.porcupine) + p.delete() + + var testPcm: [Int16] = [] + testPcm.reserveCapacity(p.frameLength) + + do { + let res = p.process(testPcm) + XCTAssert(res == 100) + } catch { + XCTAssert("\(error.localizedDescription)".count > 0) + } + } }