From 8166385818520755a05d1fa8392aab2ec2c21796 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 7 Mar 2010 10:43:16 +0000 Subject: bug fix and more tests. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2181 b956fd51-792f-4845-bead-9b4dfca2ff2c --- test/TestPortAudioDevice.pas | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/test/TestPortAudioDevice.pas b/test/TestPortAudioDevice.pas index 3b6e1cd4..10c49034 100644 --- a/test/TestPortAudioDevice.pas +++ b/test/TestPortAudioDevice.pas @@ -35,7 +35,8 @@ program TestPortAudioDevice; {$ENDIF} uses - PortAudio in '../../src/lib/portaudio/portaudio.pas'; + SysUtils, + PortAudio in '../src/lib/portaudio/portaudio.pas'; const paDefaultApi = -1; @@ -107,17 +108,39 @@ begin writeln ('*** Test of Pa_Initialize and Pa_Terminate ***'); PaError := Pa_Initialize; if PaError = paNoError then - writeln ('Pa_Initialize: NoError') + writeln ('Pa_Initialize: No error') else writeln ('Pa_Initialize: Error No ', PaError); PaError := Pa_Terminate; if PaError = paNoError then - writeln ('Pa_Terminate: NoError') + writeln ('Pa_Terminate: No error') else writeln ('Pa_Terminate: Error No: ', PaError); writeln; + writeln ('*** Test of Pa_GetVersion and Pa_GetVersionText ***'); + PaError := Pa_Initialize; + writeln ('Pa_GetVersion: ', Pa_GetVersion); + writeln ('Pa_GetVersionText: ', Pa_GetVersionText); + PaError := Pa_Terminate; + writeln; + + writeln ('*** Test of Pa_GetErrorText ***'); + PaError := Pa_Initialize; + writeln ('paNoError (0): ', Pa_GetErrorText(PaError)); + writeln; + writeln ('Code Text'); + writeln ('------------------------------------'); + i := paNotInitialized; + repeat + writeln (i:6, ' ', Pa_GetErrorText(i)); + i := succ(i); + until SameText(Pa_GetErrorText(i), 'Invalid error code') or (i = paNotInitialized + 100); + writeln (i:6, ' ', Pa_GetErrorText(i)); + PaError := Pa_Terminate; + writeln; + writeln ('*** Test of GetPreferredApiIndex ***'); PaError := Pa_Initialize; paApiIndex := GetPreferredApiIndex(); -- cgit v1.2.3