From ed5cda309c25e7080cfac13a076d0ea1e26e2ba3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 22 Feb 2025 12:50:00 +1000 Subject: [PATCH 1/2] Simplify the conversion test. --- tests/conversion/conversion.c | 381 +++++++++++++++++- .../ma_test_automated_data_converter.c | 379 ----------------- 2 files changed, 380 insertions(+), 380 deletions(-) delete mode 100644 tests/conversion/ma_test_automated_data_converter.c diff --git a/tests/conversion/conversion.c b/tests/conversion/conversion.c index 7c6336a2..5ee8d419 100644 --- a/tests/conversion/conversion.c +++ b/tests/conversion/conversion.c @@ -1,6 +1,385 @@ #include "../test_common/ma_test_common.c" -#include "ma_test_automated_data_converter.c" + +ma_result init_data_converter(ma_uint32 rateIn, ma_uint32 rateOut, ma_resample_algorithm algorithm, ma_data_converter* pDataConverter) +{ + ma_result result; + ma_data_converter_config config; + + config = ma_data_converter_config_init(ma_format_s16, ma_format_s16, 1, 1, rateIn, rateOut); + config.resampling.algorithm = algorithm; + + result = ma_data_converter_init(&config, NULL, pDataConverter); + if (result != MA_SUCCESS) { + return result; + } + + return MA_SUCCESS; +} + +#if 0 +ma_result test_data_converter__passthrough() +{ + /* + Notes: + - The isPassthrough flag should be set to true. Both the positive and negative cases need to be tested. + - ma_data_converter_set_rate() should fail with MA_INVALID_OPERATION. + - The output should be identical to the input. + */ + printf("Passthrough\n"); + + + + return MA_SUCCESS; +} +#endif + +ma_result test_data_converter__resampling_expected_output_fixed_interval(ma_data_converter* pDataConverter, ma_uint64 frameCountPerIteration) +{ + ma_result result = MA_SUCCESS; + ma_int16 input[4096]; + ma_int16 i; + + MA_ASSERT(frameCountPerIteration < ma_countof(input)); + + /* Fill the input buffer with sequential numbers so we can get an idea on the state of things. Useful for inspecting the linear backend in particular. */ + for (i = 0; i < (ma_int16)ma_countof(input); i += 1) { + input[i] = i; + } + + for (i = 0; i < (ma_int16)ma_countof(input); i += (ma_int16)frameCountPerIteration) { + ma_int16 output[4096]; + ma_uint64 outputFrameCount; + ma_uint64 inputFrameCount; + ma_uint64 expectedOutputFrameCount; + + /* We retrieve the required number of input frames for the specified number of output frames, and then compare with what we actually get when reading. */ + ma_data_converter_get_expected_output_frame_count(pDataConverter, frameCountPerIteration, &expectedOutputFrameCount); + + outputFrameCount = ma_countof(output); + inputFrameCount = frameCountPerIteration; + result = ma_data_converter_process_pcm_frames(pDataConverter, input, &inputFrameCount, output, &outputFrameCount); + if (result != MA_SUCCESS) { + printf("Failed to process frames."); + break; + } + + if (outputFrameCount != expectedOutputFrameCount) { + printf("ERROR: Predicted vs actual output count mismatch: predicted=%d, actual=%d\n", (int)expectedOutputFrameCount, (int)outputFrameCount); + result = MA_ERROR; + } + } + + if (result != MA_SUCCESS) { + printf("FAILED\n"); + } else { + printf("PASSED\n"); + } + + return result; +} + +ma_result test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(ma_resample_algorithm algorithm, ma_uint32 rateIn, ma_uint32 rateOut, ma_uint64 frameCountPerIteration) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + ma_data_converter converter; + + result = init_data_converter(rateIn, rateOut, algorithm, &converter); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_expected_output_fixed_interval(&converter, frameCountPerIteration); + + ma_data_converter_uninit(&converter, NULL); + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + +ma_result test_data_converter__resampling_expected_output_by_algorithm_fixed_interval(ma_resample_algorithm algorithm, ma_uint64 frameCountPerIteration) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + + result = test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(algorithm, 44100, 48000, frameCountPerIteration); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(algorithm, 48000, 44100, frameCountPerIteration); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + + result = test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(algorithm, 44100, 192000, frameCountPerIteration); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(algorithm, 192000, 44100, frameCountPerIteration); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + +ma_result test_data_converter__resampling_expected_output_by_algorithm(ma_resample_algorithm algorithm) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + + result = test_data_converter__resampling_expected_output_by_algorithm_fixed_interval(algorithm, 1); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_expected_output_by_algorithm_fixed_interval(algorithm, 16); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_expected_output_by_algorithm_fixed_interval(algorithm, 127); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + +ma_result test_data_converter__resampling_expected_output(void) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + + printf("Linear\n"); + result = test_data_converter__resampling_expected_output_by_algorithm(ma_resample_algorithm_linear); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + + +ma_result test_data_converter__resampling_required_input_fixed_interval(ma_data_converter* pDataConverter, ma_uint64 frameCountPerIteration) +{ + ma_result result = MA_SUCCESS; + ma_int16 input[4096]; + ma_int16 i; + + MA_ASSERT(frameCountPerIteration < ma_countof(input)); + + /* Fill the input buffer with sequential numbers so we can get an idea on the state of things. Useful for inspecting the linear backend in particular. */ + for (i = 0; i < (ma_int16)ma_countof(input); i += 1) { + input[i] = i; + } + + for (i = 0; i < (ma_int16)ma_countof(input); i += (ma_int16)frameCountPerIteration) { + ma_int16 output[4096]; + ma_uint64 outputFrameCount; + ma_uint64 inputFrameCount; + ma_uint64 requiredInputFrameCount; + + /* We retrieve the required number of input frames for the specified number of output frames, and then compare with what we actually get when reading. */ + ma_data_converter_get_required_input_frame_count(pDataConverter, frameCountPerIteration, &requiredInputFrameCount); + + outputFrameCount = frameCountPerIteration; + inputFrameCount = ma_countof(input); + result = ma_data_converter_process_pcm_frames(pDataConverter, input, &inputFrameCount, output, &outputFrameCount); + if (result != MA_SUCCESS) { + printf("Failed to process frames."); + break; + } + + if (inputFrameCount != requiredInputFrameCount) { + printf("ERROR: Predicted vs actual input count mismatch: predicted=%d, actual=%d\n", (int)requiredInputFrameCount, (int)inputFrameCount); + result = MA_ERROR; + } + } + + if (result != MA_SUCCESS) { + printf("FAILED\n"); + } else { + printf("PASSED\n"); + } + + return result; +} + +ma_result test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(ma_resample_algorithm algorithm, ma_uint32 rateIn, ma_uint32 rateOut, ma_uint64 frameCountPerIteration) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + ma_data_converter converter; + + result = init_data_converter(rateIn, rateOut, algorithm, &converter); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_required_input_fixed_interval(&converter, frameCountPerIteration); + + ma_data_converter_uninit(&converter, NULL); + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + +ma_result test_data_converter__resampling_required_input_by_algorithm_fixed_interval(ma_resample_algorithm algorithm, ma_uint64 frameCountPerIteration) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + + result = test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(algorithm, 44100, 48000, frameCountPerIteration); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(algorithm, 48000, 44100, frameCountPerIteration); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + + result = test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(algorithm, 44100, 192000, frameCountPerIteration); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(algorithm, 192000, 44100, frameCountPerIteration); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + +ma_result test_data_converter__resampling_required_input_by_algorithm(ma_resample_algorithm algorithm) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + + result = test_data_converter__resampling_required_input_by_algorithm_fixed_interval(algorithm, 1); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_required_input_by_algorithm_fixed_interval(algorithm, 16); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_required_input_by_algorithm_fixed_interval(algorithm, 127); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + +ma_result test_data_converter__resampling_required_input(void) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + + printf("Linear\n"); + result = test_data_converter__resampling_required_input_by_algorithm(ma_resample_algorithm_linear); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + + + + +ma_result test_data_converter__resampling(void) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + + result = test_data_converter__resampling_expected_output(); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + result = test_data_converter__resampling_required_input(); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + if (hasError) { + return MA_ERROR; + } else { + return MA_SUCCESS; + } +} + + +int test_entry__data_converter(int argc, char** argv) +{ + ma_result result; + ma_bool32 hasError = MA_FALSE; + + (void)argc; + (void)argv; + +#if 0 + result = test_data_converter__passthrough(); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } +#endif + + result = test_data_converter__resampling(); + if (result != MA_SUCCESS) { + hasError = MA_TRUE; + } + + + if (hasError) { + return -1; + } else { + return 0; + } +} + + int main(int argc, char** argv) { diff --git a/tests/conversion/ma_test_automated_data_converter.c b/tests/conversion/ma_test_automated_data_converter.c deleted file mode 100644 index c5a2e544..00000000 --- a/tests/conversion/ma_test_automated_data_converter.c +++ /dev/null @@ -1,379 +0,0 @@ - -ma_result init_data_converter(ma_uint32 rateIn, ma_uint32 rateOut, ma_resample_algorithm algorithm, ma_data_converter* pDataConverter) -{ - ma_result result; - ma_data_converter_config config; - - config = ma_data_converter_config_init(ma_format_s16, ma_format_s16, 1, 1, rateIn, rateOut); - config.resampling.algorithm = algorithm; - - result = ma_data_converter_init(&config, NULL, pDataConverter); - if (result != MA_SUCCESS) { - return result; - } - - return MA_SUCCESS; -} - -#if 0 -ma_result test_data_converter__passthrough() -{ - /* - Notes: - - The isPassthrough flag should be set to true. Both the positive and negative cases need to be tested. - - ma_data_converter_set_rate() should fail with MA_INVALID_OPERATION. - - The output should be identical to the input. - */ - printf("Passthrough\n"); - - - - return MA_SUCCESS; -} -#endif - -ma_result test_data_converter__resampling_expected_output_fixed_interval(ma_data_converter* pDataConverter, ma_uint64 frameCountPerIteration) -{ - ma_result result = MA_SUCCESS; - ma_int16 input[4096]; - ma_int16 i; - - MA_ASSERT(frameCountPerIteration < ma_countof(input)); - - /* Fill the input buffer with sequential numbers so we can get an idea on the state of things. Useful for inspecting the linear backend in particular. */ - for (i = 0; i < (ma_int16)ma_countof(input); i += 1) { - input[i] = i; - } - - for (i = 0; i < (ma_int16)ma_countof(input); i += (ma_int16)frameCountPerIteration) { - ma_int16 output[4096]; - ma_uint64 outputFrameCount; - ma_uint64 inputFrameCount; - ma_uint64 expectedOutputFrameCount; - - /* We retrieve the required number of input frames for the specified number of output frames, and then compare with what we actually get when reading. */ - ma_data_converter_get_expected_output_frame_count(pDataConverter, frameCountPerIteration, &expectedOutputFrameCount); - - outputFrameCount = ma_countof(output); - inputFrameCount = frameCountPerIteration; - result = ma_data_converter_process_pcm_frames(pDataConverter, input, &inputFrameCount, output, &outputFrameCount); - if (result != MA_SUCCESS) { - printf("Failed to process frames."); - break; - } - - if (outputFrameCount != expectedOutputFrameCount) { - printf("ERROR: Predicted vs actual output count mismatch: predicted=%d, actual=%d\n", (int)expectedOutputFrameCount, (int)outputFrameCount); - result = MA_ERROR; - } - } - - if (result != MA_SUCCESS) { - printf("FAILED\n"); - } else { - printf("PASSED\n"); - } - - return result; -} - -ma_result test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(ma_resample_algorithm algorithm, ma_uint32 rateIn, ma_uint32 rateOut, ma_uint64 frameCountPerIteration) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - ma_data_converter converter; - - result = init_data_converter(rateIn, rateOut, algorithm, &converter); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_expected_output_fixed_interval(&converter, frameCountPerIteration); - - ma_data_converter_uninit(&converter, NULL); - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - -ma_result test_data_converter__resampling_expected_output_by_algorithm_fixed_interval(ma_resample_algorithm algorithm, ma_uint64 frameCountPerIteration) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - - result = test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(algorithm, 44100, 48000, frameCountPerIteration); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(algorithm, 48000, 44100, frameCountPerIteration); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - - result = test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(algorithm, 44100, 192000, frameCountPerIteration); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_expected_output_by_algorithm_and_rate_fixed_interval(algorithm, 192000, 44100, frameCountPerIteration); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - -ma_result test_data_converter__resampling_expected_output_by_algorithm(ma_resample_algorithm algorithm) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - - result = test_data_converter__resampling_expected_output_by_algorithm_fixed_interval(algorithm, 1); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_expected_output_by_algorithm_fixed_interval(algorithm, 16); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_expected_output_by_algorithm_fixed_interval(algorithm, 127); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - -ma_result test_data_converter__resampling_expected_output(void) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - - printf("Linear\n"); - result = test_data_converter__resampling_expected_output_by_algorithm(ma_resample_algorithm_linear); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - - - -ma_result test_data_converter__resampling_required_input_fixed_interval(ma_data_converter* pDataConverter, ma_uint64 frameCountPerIteration) -{ - ma_result result = MA_SUCCESS; - ma_int16 input[4096]; - ma_int16 i; - - MA_ASSERT(frameCountPerIteration < ma_countof(input)); - - /* Fill the input buffer with sequential numbers so we can get an idea on the state of things. Useful for inspecting the linear backend in particular. */ - for (i = 0; i < (ma_int16)ma_countof(input); i += 1) { - input[i] = i; - } - - for (i = 0; i < (ma_int16)ma_countof(input); i += (ma_int16)frameCountPerIteration) { - ma_int16 output[4096]; - ma_uint64 outputFrameCount; - ma_uint64 inputFrameCount; - ma_uint64 requiredInputFrameCount; - - /* We retrieve the required number of input frames for the specified number of output frames, and then compare with what we actually get when reading. */ - ma_data_converter_get_required_input_frame_count(pDataConverter, frameCountPerIteration, &requiredInputFrameCount); - - outputFrameCount = frameCountPerIteration; - inputFrameCount = ma_countof(input); - result = ma_data_converter_process_pcm_frames(pDataConverter, input, &inputFrameCount, output, &outputFrameCount); - if (result != MA_SUCCESS) { - printf("Failed to process frames."); - break; - } - - if (inputFrameCount != requiredInputFrameCount) { - printf("ERROR: Predicted vs actual input count mismatch: predicted=%d, actual=%d\n", (int)requiredInputFrameCount, (int)inputFrameCount); - result = MA_ERROR; - } - } - - if (result != MA_SUCCESS) { - printf("FAILED\n"); - } else { - printf("PASSED\n"); - } - - return result; -} - -ma_result test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(ma_resample_algorithm algorithm, ma_uint32 rateIn, ma_uint32 rateOut, ma_uint64 frameCountPerIteration) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - ma_data_converter converter; - - result = init_data_converter(rateIn, rateOut, algorithm, &converter); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_required_input_fixed_interval(&converter, frameCountPerIteration); - - ma_data_converter_uninit(&converter, NULL); - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - -ma_result test_data_converter__resampling_required_input_by_algorithm_fixed_interval(ma_resample_algorithm algorithm, ma_uint64 frameCountPerIteration) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - - result = test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(algorithm, 44100, 48000, frameCountPerIteration); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(algorithm, 48000, 44100, frameCountPerIteration); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - - result = test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(algorithm, 44100, 192000, frameCountPerIteration); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_required_input_by_algorithm_and_rate_fixed_interval(algorithm, 192000, 44100, frameCountPerIteration); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - -ma_result test_data_converter__resampling_required_input_by_algorithm(ma_resample_algorithm algorithm) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - - result = test_data_converter__resampling_required_input_by_algorithm_fixed_interval(algorithm, 1); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_required_input_by_algorithm_fixed_interval(algorithm, 16); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_required_input_by_algorithm_fixed_interval(algorithm, 127); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - -ma_result test_data_converter__resampling_required_input(void) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - - printf("Linear\n"); - result = test_data_converter__resampling_required_input_by_algorithm(ma_resample_algorithm_linear); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - - - - -ma_result test_data_converter__resampling(void) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - - result = test_data_converter__resampling_expected_output(); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - result = test_data_converter__resampling_required_input(); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - if (hasError) { - return MA_ERROR; - } else { - return MA_SUCCESS; - } -} - - -int test_entry__data_converter(int argc, char** argv) -{ - ma_result result; - ma_bool32 hasError = MA_FALSE; - - (void)argc; - (void)argv; - -#if 0 - result = test_data_converter__passthrough(); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } -#endif - - result = test_data_converter__resampling(); - if (result != MA_SUCCESS) { - hasError = MA_TRUE; - } - - - if (hasError) { - return -1; - } else { - return 0; - } -} From e1f5ed4f793e4c0af7f8adf7dec18935dc67987b Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 22 Feb 2025 13:00:06 +1000 Subject: [PATCH 2/2] Rename some more test source files. --- .../ma_test_common.c => common/common.c} | 0 tests/conversion/conversion.c | 2 +- tests/deviceio/deviceio.c | 2 +- tests/emscripten/emscripten.c | 3 +-- tests/filtering/filtering.c | 18 +++++++++--------- ...ma_test_filtering_bpf.c => filtering_bpf.c} | 0 ...ering_dithering.c => filtering_dithering.c} | 0 ...filtering_hishelf.c => filtering_hishelf.c} | 0 ...ma_test_filtering_hpf.c => filtering_hpf.c} | 0 ...filtering_loshelf.c => filtering_loshelf.c} | 0 ...ma_test_filtering_lpf.c => filtering_lpf.c} | 0 ...est_filtering_notch.c => filtering_notch.c} | 0 ..._test_filtering_peak.c => filtering_peak.c} | 0 tests/generation/generation.c | 6 +++--- ...t_generation_noise.c => generation_noise.c} | 0 ...ration_waveform.c => generation_waveform.c} | 0 16 files changed, 15 insertions(+), 16 deletions(-) rename tests/{test_common/ma_test_common.c => common/common.c} (100%) rename tests/filtering/{ma_test_filtering_bpf.c => filtering_bpf.c} (100%) rename tests/filtering/{ma_test_filtering_dithering.c => filtering_dithering.c} (100%) rename tests/filtering/{ma_test_filtering_hishelf.c => filtering_hishelf.c} (100%) rename tests/filtering/{ma_test_filtering_hpf.c => filtering_hpf.c} (100%) rename tests/filtering/{ma_test_filtering_loshelf.c => filtering_loshelf.c} (100%) rename tests/filtering/{ma_test_filtering_lpf.c => filtering_lpf.c} (100%) rename tests/filtering/{ma_test_filtering_notch.c => filtering_notch.c} (100%) rename tests/filtering/{ma_test_filtering_peak.c => filtering_peak.c} (100%) rename tests/generation/{ma_test_generation_noise.c => generation_noise.c} (100%) rename tests/generation/{ma_test_generation_waveform.c => generation_waveform.c} (100%) diff --git a/tests/test_common/ma_test_common.c b/tests/common/common.c similarity index 100% rename from tests/test_common/ma_test_common.c rename to tests/common/common.c diff --git a/tests/conversion/conversion.c b/tests/conversion/conversion.c index 5ee8d419..904676f3 100644 --- a/tests/conversion/conversion.c +++ b/tests/conversion/conversion.c @@ -1,5 +1,5 @@ -#include "../test_common/ma_test_common.c" +#include "../common/common.c" ma_result init_data_converter(ma_uint32 rateIn, ma_uint32 rateOut, ma_resample_algorithm algorithm, ma_data_converter* pDataConverter) { diff --git a/tests/deviceio/deviceio.c b/tests/deviceio/deviceio.c index effc0027..5590abf5 100644 --- a/tests/deviceio/deviceio.c +++ b/tests/deviceio/deviceio.c @@ -41,7 +41,7 @@ will receive the captured audio. If multiple backends are specified, the priority will be based on the order in which you specify them. If multiple waveform or noise types are specified the last one on the command line will have priority. */ -#include "../test_common/ma_test_common.c" +#include "../common/common.c" #ifndef AUTO_CLOSE_TIME_IN_MILLISECONDS #define AUTO_CLOSE_TIME_IN_MILLISECONDS 5000 diff --git a/tests/emscripten/emscripten.c b/tests/emscripten/emscripten.c index 9cdd0c64..4a5fc1ea 100644 --- a/tests/emscripten/emscripten.c +++ b/tests/emscripten/emscripten.c @@ -1,8 +1,7 @@ #define MA_DEBUG_OUTPUT #define MA_NO_DECODING #define MA_NO_ENCODING -#define MINIAUDIO_IMPLEMENTATION -#include "../../miniaudio.h" +#include "../../miniaudio.c" #include diff --git a/tests/filtering/filtering.c b/tests/filtering/filtering.c index fb2e3d9c..88732b50 100644 --- a/tests/filtering/filtering.c +++ b/tests/filtering/filtering.c @@ -1,4 +1,4 @@ -#include "../test_common/ma_test_common.c" +#include "../common/common.c" ma_result filtering_init_decoder_and_encoder(const char* pInputFilePath, const char* pOutputFilePath, ma_format format, ma_uint32 channels, ma_uint32 sampleRate, ma_decoder* pDecoder, ma_encoder* pEncoder) { @@ -24,14 +24,14 @@ ma_result filtering_init_decoder_and_encoder(const char* pInputFilePath, const c return MA_SUCCESS; } -#include "ma_test_filtering_dithering.c" -#include "ma_test_filtering_lpf.c" -#include "ma_test_filtering_hpf.c" -#include "ma_test_filtering_bpf.c" -#include "ma_test_filtering_notch.c" -#include "ma_test_filtering_peak.c" -#include "ma_test_filtering_loshelf.c" -#include "ma_test_filtering_hishelf.c" +#include "filtering_dithering.c" +#include "filtering_lpf.c" +#include "filtering_hpf.c" +#include "filtering_bpf.c" +#include "filtering_notch.c" +#include "filtering_peak.c" +#include "filtering_loshelf.c" +#include "filtering_hishelf.c" int main(int argc, char** argv) { diff --git a/tests/filtering/ma_test_filtering_bpf.c b/tests/filtering/filtering_bpf.c similarity index 100% rename from tests/filtering/ma_test_filtering_bpf.c rename to tests/filtering/filtering_bpf.c diff --git a/tests/filtering/ma_test_filtering_dithering.c b/tests/filtering/filtering_dithering.c similarity index 100% rename from tests/filtering/ma_test_filtering_dithering.c rename to tests/filtering/filtering_dithering.c diff --git a/tests/filtering/ma_test_filtering_hishelf.c b/tests/filtering/filtering_hishelf.c similarity index 100% rename from tests/filtering/ma_test_filtering_hishelf.c rename to tests/filtering/filtering_hishelf.c diff --git a/tests/filtering/ma_test_filtering_hpf.c b/tests/filtering/filtering_hpf.c similarity index 100% rename from tests/filtering/ma_test_filtering_hpf.c rename to tests/filtering/filtering_hpf.c diff --git a/tests/filtering/ma_test_filtering_loshelf.c b/tests/filtering/filtering_loshelf.c similarity index 100% rename from tests/filtering/ma_test_filtering_loshelf.c rename to tests/filtering/filtering_loshelf.c diff --git a/tests/filtering/ma_test_filtering_lpf.c b/tests/filtering/filtering_lpf.c similarity index 100% rename from tests/filtering/ma_test_filtering_lpf.c rename to tests/filtering/filtering_lpf.c diff --git a/tests/filtering/ma_test_filtering_notch.c b/tests/filtering/filtering_notch.c similarity index 100% rename from tests/filtering/ma_test_filtering_notch.c rename to tests/filtering/filtering_notch.c diff --git a/tests/filtering/ma_test_filtering_peak.c b/tests/filtering/filtering_peak.c similarity index 100% rename from tests/filtering/ma_test_filtering_peak.c rename to tests/filtering/filtering_peak.c diff --git a/tests/generation/generation.c b/tests/generation/generation.c index f04397c7..31d9fecd 100644 --- a/tests/generation/generation.c +++ b/tests/generation/generation.c @@ -1,8 +1,8 @@ #define MA_NO_DEVICE_IO -#include "../test_common/ma_test_common.c" +#include "../common/common.c" -#include "ma_test_generation_noise.c" -#include "ma_test_generation_waveform.c" +#include "generation_noise.c" +#include "generation_waveform.c" int main(int argc, char** argv) { diff --git a/tests/generation/ma_test_generation_noise.c b/tests/generation/generation_noise.c similarity index 100% rename from tests/generation/ma_test_generation_noise.c rename to tests/generation/generation_noise.c diff --git a/tests/generation/ma_test_generation_waveform.c b/tests/generation/generation_waveform.c similarity index 100% rename from tests/generation/ma_test_generation_waveform.c rename to tests/generation/generation_waveform.c