Added paloopback test to the automated build.

This commit is contained in:
philburk 2011-03-01 01:54:20 +00:00
commit 8a905a2a19
4 changed files with 31 additions and 24 deletions

View file

@ -146,9 +146,6 @@ int PaQa_WriteRecording( PaQaRecording *recording, float *buffer, int numFrames,
}
recording->numFrames += framesToWrite;
return (recording->numFrames >= recording->maxFrames);
error:
return -1;
}
/*==========================================================================================*/
@ -166,9 +163,6 @@ int PaQa_WriteSilence( PaQaRecording *recording, int numFrames )
}
recording->numFrames += framesToRecord;
return (recording->numFrames >= recording->maxFrames);
error:
return -1;
}
/*==========================================================================================*/
@ -187,9 +181,6 @@ int PaQa_RecordFreeze( PaQaRecording *recording, int numFrames )
}
recording->numFrames += framesToRecord;
return (recording->numFrames >= recording->maxFrames);
error:
return -1;
}
/*==========================================================================================*/
@ -518,7 +509,7 @@ int PaQa_DetectPhaseError( PaQaRecording *recording, PaQaTestTone *testTone, PaQ
double phase = 666.0;
double mag = PaQa_CorrelateSine( recording, testTone->frequency, testTone->sampleRate, i, windowSize, &phase );
if( loopCount > 1)
if( (loopCount > 1) && (mag > 0.0) )
{
double phaseDelta = PaQa_ComputePhaseDifference( phase, previousPhase );
double phaseError = PaQa_ComputePhaseDifference( phaseDelta, expectedPhaseIncrement );
@ -573,7 +564,7 @@ int PaQa_AnalyseRecording( PaQaRecording *recording, PaQaTestTone *testTone, PaQ
if( (analysisResult->latency >= 0) && (analysisResult->amplitudeRatio > 0.1) )
{
analysisResult->valid = 1;
analysisResult->valid = (1);
result = PaQa_DetectPop( recording, testTone, analysisResult );
QA_ASSERT_EQUALS( "detect pop", 0, result );
@ -584,4 +575,5 @@ int PaQa_AnalyseRecording( PaQaRecording *recording, PaQaTestTone *testTone, PaQ
return 0;
error:
return -1;
}
}

View file

@ -53,7 +53,7 @@ extern int g_testsFailed;
#define QA_ASSERT_EQUALS( message, expected, actual ) \
if( (expected) != (actual) ) \
if( ((expected) != (actual)) ) \
{ \
printf( "%s:%d - ERROR - %s, expected %d, got %d\n", __FILE__, __LINE__, message, expected, actual ); \
g_testsFailed++; \

View file

@ -48,6 +48,8 @@
#define FRAMES_PER_BLOCK (64)
#define PRINT_REPORTS 0
#define TEST_SAVED_WAVE (0)
/*==========================================================================================*/
/**
* Detect a single tone.
@ -425,7 +427,7 @@ static int TestDetectPops( void )
return 0;
}
#if TEST_SAVED_WAVE
/*==========================================================================================*/
/**
* Simple test that write a sawtooth waveform to a file.
@ -464,6 +466,7 @@ error:
printf("ERROR: result = %d\n", result );
return result;
}
#endif /* TEST_SAVED_WAVE */
/*==========================================================================================*/
/**
@ -558,26 +561,26 @@ error:
int PaQa_TestAnalyzer( void )
{
int result;
#if TEST_SAVED_WAVE
// Write a simple wave file.
//if (result = TestSavedWave()) return result;
if ((result = TestSavedWave()) != 0) return result;
#endif /* TEST_SAVED_WAVE */
// Generate single tone and verify presence.
if (result = TestSingleMonoTone()) return result;
if ((result = TestSingleMonoTone()) != 0) return result;
// Generate prime series of tones and verify presence.
if (result = TestMixedMonoTones()) return result;
if ((result = TestMixedMonoTones()) != 0) return result;
// Detect dropped or added samples in a sine wave recording.
if (result = TestDetectPhaseErrors()) return result;
if ((result = TestDetectPhaseErrors()) != 0) return result;
// Test to see if notch filter can knock out the test tone.
if (result = TestNotchFilter()) return result;
if ((result = TestNotchFilter()) != 0) return result;
// Detect pops that get back in phase.
if (result = TestDetectPops()) return result;
if ((result = TestDetectPops()) != 0) return result;
return 0;
}