Skip to content

Commit

Permalink
add new ref file
Browse files Browse the repository at this point in the history
  • Loading branch information
RinoReyns committed Nov 16, 2024
1 parent 14e9a76 commit bdefb6b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Binary file not shown.
5 changes: 4 additions & 1 deletion VstHost_VisualC++/modules/UnitTests/header/UnitTestsCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ const std::string REF_OUTPUT_WITH_TWO_PLUGINS_2 = UT_DATA_FOLDER + "sine_440
const std::string PROCESSING_CONFIG_PATH = UT_DATA_FOLDER + "processing_config.json";
const std::string PLUGIN_NAME = "plugin_1";
const std::string REF_FILTRATED = UT_DATA_FOLDER + "sine_440_filtrated.wav";
const float FILTRATION_PRECISION = 1e-9;
const std::string REF_PRE_POST_PROC = UT_DATA_FOLDER + "sine_440_filtrated_pre_and_post_proc.wav";

const float PRECISION_9_DECIMAL_PLACES = 1e-9;
const float PRECISION_8_DECIMAL_PLACES = 1e-8;
const int8_t MODULES_COUNT = 6;
const int8_t DELAY_PARAMS_COUNT = 2;
const std::string APP_CONFIG_PARAM = "-config";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ namespace AudioProcessingWrapperClassUnitTest
std::vector<float> ref;
status = LoadWave(REF_FILTRATED, &ref);
EXPECT_EQ(status, VST_ERROR_STATUS::SUCCESS);
ASSERT_THAT(output, testing::Pointwise(testing::FloatNear(FILTRATION_PRECISION), ref));
ASSERT_THAT(output, testing::Pointwise(testing::FloatNear(PRECISION_9_DECIMAL_PLACES), ref));
#endif //!__APPLE__
}

Expand Down
15 changes: 8 additions & 7 deletions VstHost_VisualC++/modules/UnitTests/src/VstHostToolUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace VstHostToolUnitTest
}
else
{
ASSERT_THAT(output, testing::Pointwise(testing::FloatNear(FILTRATION_PRECISION), ref));
ASSERT_THAT(output, testing::Pointwise(testing::FloatNear(PRECISION_8_DECIMAL_PLACES), ref));
}
}
}
Expand Down Expand Up @@ -408,9 +408,9 @@ namespace VstHostToolUnitTest
status = JsonUtils::DumpJson(json_config, PROCESSING_CONFIG_PATH);
EXPECT_EQ(status, VST_ERROR_STATUS::SUCCESS);
#ifndef __APPLE__
AppProcessingWithOutputValidation(REF_FILTRATED, true, false);
AppProcessingWithOutputValidation(REF_PRE_POST_PROC, true, false);
#else
AppProcessingWithOutputValidation(REF_FILTRATED, false);
AppProcessingWithOutputValidation(REF_PRE_POST_PROC, false);
#endif //!__APPLE__
}

Expand All @@ -425,14 +425,15 @@ namespace VstHostToolUnitTest
status = JsonUtils::DumpJson(json_config, PROCESSING_CONFIG_PATH);
EXPECT_EQ(status, VST_ERROR_STATUS::SUCCESS);
#ifndef __APPLE__
AppProcessingWithOutputValidation(REF_FILTRATED, true, false);
AppProcessingWithOutputValidation(REF_PRE_POST_PROC, true, false);
#else
AppProcessingWithOutputValidation(REF_FILTRATED, false);
AppProcessingWithOutputValidation(REF_PRE_POST_PROC, false);
#endif //!__APPLE__

}

// TODO:
// Prepare reference each test
// Prepare reference for each test RunToolWithPreprocessingOnly
// also for RunToolWithPostprocessingOnly and
// Add test for pre and post processing
// Add test for preprocessing + vst_host
// Add test for postprocessing + vst_host
Expand Down

0 comments on commit bdefb6b

Please sign in to comment.