From 3e48025d5f9bcc135821898fecf6b2f297cbbdd6 Mon Sep 17 00:00:00 2001 From: Simon Weis Date: Thu, 19 May 2022 17:53:01 +0200 Subject: [PATCH 1/4] Use wav file in approval tests --- assets/test1.wav | Bin 0 -> 23216 bytes test/approval_tests/approval_test_helpers.cpp | 6 ----- test/approval_tests/approval_test_helpers.hpp | 9 ------- ..._convolution_test.convolution.approved.txt | 4 +-- .../effect_gain_test.gain.1.0.approved.txt | 4 +-- .../effect_gain_test.gain.2.0.approved.txt | 4 +-- ...ct_phase_flip_test.phase_flip.approved.txt | 3 +++ ...ct_phase_flip_test.phase_flip.received.txt | 3 +++ .../effect_convolution_test.cpp | 11 ++------- test/approval_tests/effect_gain_test.cpp | 23 +++--------------- .../approval_tests/effect_phase_flip_test.cpp | 14 +++++++++++ 11 files changed, 32 insertions(+), 49 deletions(-) create mode 100644 assets/test1.wav delete mode 100644 test/approval_tests/approval_test_helpers.cpp delete mode 100644 test/approval_tests/approval_test_helpers.hpp create mode 100644 test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.approved.txt create mode 100644 test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.received.txt create mode 100644 test/approval_tests/effect_phase_flip_test.cpp diff --git a/assets/test1.wav b/assets/test1.wav new file mode 100644 index 0000000000000000000000000000000000000000..28abc0d1792e964638d723f7a325548987497045 GIT binary patch literal 23216 zcmW)n1(ek0*T#|ENiuPtUEJL%?nR5c71x$RixewbiWMsqcXu!D?yig5?oQk%lUZcH z_y3(anY?)?^Zf4f+?%2096GdU+H_}+967o+?9ycL@G%9c965621h2+>bL5!QEoY8g zIj9^1`;F=M7r5tPl}Y8Ka@EV#D{Gbgr|hP(=gO`tTdB-{WiFH}S^l5$Y`N-X29-%I z*P>*+%=e{ARD4ycV(F>nZx*}yZ2qIBPoF+{^SIZOAD+B;qCeU3q}}u0PfI^7_;kmU zna``gSo*YjTIfZ!w1sK8p4E9e{Q2&*Suf|798=ADSMPGe*IrQZ(FMGbiUY>f`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hXedc@ zk6l*()@Ag{eQ+KtyASZx=kVNT!ZJ>y_Ftr(a>nKM8T>)7NgjG1|8?#o@`h;glBAOd zElA_+aaG%AO_64C|)Cc>DzN8QFRefP!&X@A} zaRwnO=yUl(KG4_j#r-@VPtwR<@{F7y@#G=-2aIFnJUN5f)sN9la*5m{N02=r7eU{F zXcB1xg$_`!@2mMTP^#=3`dY|Z`zpQx@+!Wjui%^D{O`83?}UABdzeh~T}ig+5T)BQN?ll%Zb+fVQdd|l{# z2ihp|1Nk1&bTWaAA^q`8Ko*U9Uz~l(U^3)m?OQSe-|Gsd|BL_GFY*ih5la8bVX-V3UK2T~;T99u@6zPhm&BwSU zX+|0#YDXHQQlGr{yZvUr&2Ptf*zfZj{3gH0@ArHCF4VXC1Nc*S)W_lOG^%m_1om@Y zkm`6hf_z27NjXx5)Ws7{zQ7ZXdNmS;s619BQUY;#5=yF)Qbdre{-nR+|M55cLx0O( zfYL4G*RY?$x{v6ozwYn)WPj5?@{h4U_r@0^Wl14YoP0uZVHG1GB$yN-1xOxJ22pNQ zvf%y`!bv`onPkIF79z{2w$j8rT2; literal 0 HcmV?d00001 diff --git a/test/approval_tests/approval_test_helpers.cpp b/test/approval_tests/approval_test_helpers.cpp deleted file mode 100644 index 4268a6d..0000000 --- a/test/approval_tests/approval_test_helpers.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "approval_test_helpers.hpp" - -int ApprovalTestHelpers::asInt(float number, unsigned int digits) -{ - return static_cast(number * digits); -} diff --git a/test/approval_tests/approval_test_helpers.hpp b/test/approval_tests/approval_test_helpers.hpp deleted file mode 100644 index 0b1745c..0000000 --- a/test/approval_tests/approval_test_helpers.hpp +++ /dev/null @@ -1,9 +0,0 @@ - -#ifndef OPENALPP_APPROVAL_TEST_HELPERS_HPP -#define OPENALPP_APPROVAL_TEST_HELPERS_HPP - -struct ApprovalTestHelpers { - static int asInt(float number, unsigned int digits); -}; - -#endif // OPENALPP_APPROVAL_TEST_HELPERS_HPP diff --git a/test/approval_tests/approval_tests/effect_convolution_test.convolution.approved.txt b/test/approval_tests/approval_tests/effect_convolution_test.convolution.approved.txt index 1afb584..34e89bf 100644 --- a/test/approval_tests/approval_tests/effect_convolution_test.convolution.approved.txt +++ b/test/approval_tests/approval_tests/effect_convolution_test.convolution.approved.txt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:85dd6027e6047916f77681930f93dd3ae37a1dd65dc42ae2ba757642a43282b7 -size 225746 +oid sha256:21a1d1f53c69b83540b154b981885280b2399439eb25804f13f84d81b0f854e3 +size 323799 diff --git a/test/approval_tests/approval_tests/effect_gain_test.gain.1.0.approved.txt b/test/approval_tests/approval_tests/effect_gain_test.gain.1.0.approved.txt index 035bdf7..e95a4ca 100644 --- a/test/approval_tests/approval_tests/effect_gain_test.gain.1.0.approved.txt +++ b/test/approval_tests/approval_tests/effect_gain_test.gain.1.0.approved.txt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1af33a77fc48c7b7f374272f893ab82cff148173553b252f06bb148d916f7474 -size 161884 +oid sha256:de49ca1dcba4799827f502d87257a63d24f505bacc0a82107d7b6b38ad9e1706 +size 231807 diff --git a/test/approval_tests/approval_tests/effect_gain_test.gain.2.0.approved.txt b/test/approval_tests/approval_tests/effect_gain_test.gain.2.0.approved.txt index 3a25a2f..482209d 100644 --- a/test/approval_tests/approval_tests/effect_gain_test.gain.2.0.approved.txt +++ b/test/approval_tests/approval_tests/effect_gain_test.gain.2.0.approved.txt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c637fe442cd52c15f73e3f79bccf433651d3563b92eb1917cb96128ef6168411 -size 153675 +oid sha256:a4fa58b6c00f509ff09c6bc93d960a9a30fc19c249f7cfde18d14c16c5769d07 +size 228530 diff --git a/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.approved.txt b/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.approved.txt new file mode 100644 index 0000000..58a4e8d --- /dev/null +++ b/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.approved.txt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:951e8c8d7fe4b5d659ae576cbf715eec5be6eb187123f73fa79fb68b5c8681a9 +size 231811 diff --git a/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.received.txt b/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.received.txt new file mode 100644 index 0000000..58a4e8d --- /dev/null +++ b/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.received.txt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:951e8c8d7fe4b5d659ae576cbf715eec5be6eb187123f73fa79fb68b5c8681a9 +size 231811 diff --git a/test/approval_tests/effect_convolution_test.cpp b/test/approval_tests/effect_convolution_test.cpp index 02e505c..63c3ef8 100644 --- a/test/approval_tests/effect_convolution_test.cpp +++ b/test/approval_tests/effect_convolution_test.cpp @@ -1,21 +1,14 @@ #include "ApprovalTests/ApprovalTests.hpp" -#include "approval_test_helpers.hpp" #include "catch2/catch.hpp" #include "oalpp/effects/utility/convolution.hpp" #include "oalpp/sound_data.hpp" TEST_CASE("convolution") { - std::string const fileName { "assets/test1.ogg" }; + std::string const fileName { "assets/test1.wav" }; oalpp::SoundData buffer { fileName }; oalpp::effects::utility::Convolution convolution { buffer.getSamples() }; oalpp::SoundDataWithEffect soundWithEffect { buffer, convolution }; - std::vector values; - values.resize(soundWithEffect.getSamples().size()); - - std::transform(soundWithEffect.getSamples().cbegin(), soundWithEffect.getSamples().cend(), - values.begin(), [](float const value) { return ApprovalTestHelpers::asInt(value, 100); }); - - ApprovalTests::Approvals::verifyAll(values); + ApprovalTests::Approvals::verifyAll(soundWithEffect.getSamples()); } diff --git a/test/approval_tests/effect_gain_test.cpp b/test/approval_tests/effect_gain_test.cpp index 3ae4648..bea7ce1 100644 --- a/test/approval_tests/effect_gain_test.cpp +++ b/test/approval_tests/effect_gain_test.cpp @@ -1,5 +1,4 @@ #include "ApprovalTests/ApprovalTests.hpp" -#include "approval_test_helpers.hpp" #include "catch2/catch.hpp" #include "oalpp/effects/utility/gain.hpp" #include "oalpp/sound_data.hpp" @@ -8,34 +7,20 @@ TEST_CASE("gain") { SECTION("1.0") { - std::string const fileName { "assets/test1.ogg" }; + std::string const fileName { "assets/test1.wav" }; oalpp::effects::utility::Gain gain { 1.0f }; oalpp::SoundData buffer { fileName }; oalpp::SoundDataWithEffect soundWithEffect { buffer, gain }; - std::vector values; - values.resize(soundWithEffect.getSamples().size()); - - std::transform(soundWithEffect.getSamples().cbegin(), soundWithEffect.getSamples().cend(), - values.begin(), - [](float const value) { return ApprovalTestHelpers::asInt(value, 1000); }); - - ApprovalTests::Approvals::verifyAll(values); + ApprovalTests::Approvals::verifyAll(soundWithEffect.getSamples()); } SECTION("2.0") { - std::string const fileName { "assets/test1.ogg" }; + std::string const fileName { "assets/test1.wav" }; oalpp::effects::utility::Gain gain { 2.0f }; oalpp::SoundData buffer { fileName }; oalpp::SoundDataWithEffect soundWithEffect { buffer, gain }; - std::vector values; - values.resize(soundWithEffect.getSamples().size()); - - std::transform(soundWithEffect.getSamples().cbegin(), soundWithEffect.getSamples().cend(), - values.begin(), - [](float const value) { return ApprovalTestHelpers::asInt(value, 100); }); - - ApprovalTests::Approvals::verifyAll(values); + ApprovalTests::Approvals::verifyAll(soundWithEffect.getSamples()); } } diff --git a/test/approval_tests/effect_phase_flip_test.cpp b/test/approval_tests/effect_phase_flip_test.cpp new file mode 100644 index 0000000..e23275c --- /dev/null +++ b/test/approval_tests/effect_phase_flip_test.cpp @@ -0,0 +1,14 @@ +#include "ApprovalTests/ApprovalTests.hpp" +#include "catch2/catch.hpp" +#include "oalpp/effects/utility/phase_flip.hpp" +#include "oalpp/sound_data.hpp" + +TEST_CASE("phase_flip") +{ + std::string const fileName { "assets/test1.wav" }; + oalpp::SoundData buffer { fileName }; + oalpp::effects::utility::PhaseFlip phaseFlip { }; + oalpp::SoundDataWithEffect soundWithEffect { buffer, phaseFlip }; + + ApprovalTests::Approvals::verifyAll(soundWithEffect.getSamples()); +} From 38987f0d988e263ee8af54bd57068431de5c095c Mon Sep 17 00:00:00 2001 From: Simon Weis Date: Thu, 19 May 2022 17:58:07 +0200 Subject: [PATCH 2/4] Add approvaltests to linux clang build --- .github/workflows/test_verification.yml | 11 +++++++++-- test/approval_tests/approval_test_helpers.cpp | 11 +++++++++++ test/approval_tests/approval_test_helpers.hpp | 9 +++++++++ .../effect_convolution_test.convolution.approved.txt | 4 ++-- .../effect_phase_flip_test.phase_flip.received.txt | 3 --- test/approval_tests/effect_convolution_test.cpp | 5 ++++- 6 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 test/approval_tests/approval_test_helpers.cpp create mode 100644 test/approval_tests/approval_test_helpers.hpp delete mode 100644 test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.received.txt diff --git a/.github/workflows/test_verification.yml b/.github/workflows/test_verification.yml index 4393526..a404028 100644 --- a/.github/workflows/test_verification.yml +++ b/.github/workflows/test_verification.yml @@ -92,12 +92,19 @@ jobs: - name: Build working-directory: ${{github.workspace}}/build - run: make OpenALpp_UnitTests OpenALpp_Integration -j 4 + run: make OpenALpp_UnitTests OpenALpp_Integration OpenALpp_ApprovalTests -j - # - name: Test + # Commented out because one does not simply acquire a sound context # run: ./OpenALpp_UnitTests --order rand # working-directory: ${{github.workspace}}/build/bin/ + - name: CopyAssets + run: cp -r ${{github.workspace}}/assets ${{github.workspace}}/build/test/approval_tests + + - name: ApprovalTest + run: ./OpenALpp_ApprovalTests --order rand + working-directory: ${{github.workspace}}/build/test/approval_tests + Windows: runs-on: windows-2019 steps: diff --git a/test/approval_tests/approval_test_helpers.cpp b/test/approval_tests/approval_test_helpers.cpp new file mode 100644 index 0000000..fe36f17 --- /dev/null +++ b/test/approval_tests/approval_test_helpers.cpp @@ -0,0 +1,11 @@ +#include "approval_test_helpers.hpp" +#include + +std::vector ApprovalTestHelpers::asInt(std::vector const& numbers, unsigned int digits) +{ + std::vector numbersAsInts; + numbersAsInts.resize(numbers.size()); + std::transform(numbers.cbegin(), numbers.cend(), numbersAsInts.begin(), [digits](float number) + {return static_cast(number * digits);}); + return numbersAsInts; +} diff --git a/test/approval_tests/approval_test_helpers.hpp b/test/approval_tests/approval_test_helpers.hpp new file mode 100644 index 0000000..e12cfdb --- /dev/null +++ b/test/approval_tests/approval_test_helpers.hpp @@ -0,0 +1,9 @@ +#ifndef OPENALPP_APPROVAL_TEST_HELPERS_HPP +#define OPENALPP_APPROVAL_TEST_HELPERS_HPP +#include + +struct ApprovalTestHelpers { + static std::vector ApprovalTestHelpers::asInt(std::vector const& number, unsigned int digits); +}; + +#endif // OPENALPP_APPROVAL_TEST_HELPERS_HPP diff --git a/test/approval_tests/approval_tests/effect_convolution_test.convolution.approved.txt b/test/approval_tests/approval_tests/effect_convolution_test.convolution.approved.txt index 34e89bf..43a5117 100644 --- a/test/approval_tests/approval_tests/effect_convolution_test.convolution.approved.txt +++ b/test/approval_tests/approval_tests/effect_convolution_test.convolution.approved.txt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:21a1d1f53c69b83540b154b981885280b2399439eb25804f13f84d81b0f854e3 -size 323799 +oid sha256:0449f68287f531a26c6494a8ccf764bdba2f39b967f75970b1fa567a0af64bc1 +size 225747 diff --git a/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.received.txt b/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.received.txt deleted file mode 100644 index 58a4e8d..0000000 --- a/test/approval_tests/approval_tests/effect_phase_flip_test.phase_flip.received.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:951e8c8d7fe4b5d659ae576cbf715eec5be6eb187123f73fa79fb68b5c8681a9 -size 231811 diff --git a/test/approval_tests/effect_convolution_test.cpp b/test/approval_tests/effect_convolution_test.cpp index 63c3ef8..ecb40c0 100644 --- a/test/approval_tests/effect_convolution_test.cpp +++ b/test/approval_tests/effect_convolution_test.cpp @@ -2,6 +2,7 @@ #include "catch2/catch.hpp" #include "oalpp/effects/utility/convolution.hpp" #include "oalpp/sound_data.hpp" +#include "approval_test_helpers.hpp" TEST_CASE("convolution") { @@ -10,5 +11,7 @@ TEST_CASE("convolution") oalpp::effects::utility::Convolution convolution { buffer.getSamples() }; oalpp::SoundDataWithEffect soundWithEffect { buffer, convolution }; - ApprovalTests::Approvals::verifyAll(soundWithEffect.getSamples()); + // note: Due to platform dependent float behavior, the result needs to be converted to int for + // the approval tests to work. + ApprovalTests::Approvals::verifyAll(ApprovalTestHelpers::asInt(soundWithEffect.getSamples(), 100)); } From c5dfe3d16f197dc7f9433ced9c205b660f7df17e Mon Sep 17 00:00:00 2001 From: Simon Weis Date: Thu, 19 May 2022 18:19:58 +0200 Subject: [PATCH 3/4] mend --- test/approval_tests/approval_test_helpers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/approval_tests/approval_test_helpers.hpp b/test/approval_tests/approval_test_helpers.hpp index e12cfdb..3364336 100644 --- a/test/approval_tests/approval_test_helpers.hpp +++ b/test/approval_tests/approval_test_helpers.hpp @@ -3,7 +3,7 @@ #include struct ApprovalTestHelpers { - static std::vector ApprovalTestHelpers::asInt(std::vector const& number, unsigned int digits); + static std::vector asInt(std::vector const& number, unsigned int digits); }; #endif // OPENALPP_APPROVAL_TEST_HELPERS_HPP From 0f3dd3f93d55584428ab561983e9b8e1ff0cb49c Mon Sep 17 00:00:00 2001 From: Simon Weis Date: Thu, 19 May 2022 18:33:34 +0200 Subject: [PATCH 4/4] Remove approval tests from clang --- .github/workflows/test_verification.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_verification.yml b/.github/workflows/test_verification.yml index a404028..11486bb 100644 --- a/.github/workflows/test_verification.yml +++ b/.github/workflows/test_verification.yml @@ -98,12 +98,13 @@ jobs: # run: ./OpenALpp_UnitTests --order rand # working-directory: ${{github.workspace}}/build/bin/ - - name: CopyAssets - run: cp -r ${{github.workspace}}/assets ${{github.workspace}}/build/test/approval_tests - - - name: ApprovalTest - run: ./OpenALpp_ApprovalTests --order rand - working-directory: ${{github.workspace}}/build/test/approval_tests +# Do not run approval tests on clang as there seem to be some float inconsistencies happening +# - name: CopyAssets +# run: cp -r ${{github.workspace}}/assets ${{github.workspace}}/build/test/approval_tests +# +# - name: ApprovalTest +# run: ./OpenALpp_ApprovalTests --order rand +# working-directory: ${{github.workspace}}/build/test/approval_tests Windows: runs-on: windows-2019