Skip to content

Commit 563f5c2

Browse files
authored
Merge pull request #104 from pedrolcl/tests_and_workflows_simplification
Tests and workflows simplification
2 parents 0fb0a68 + df26f9c commit 563f5c2

8 files changed

Lines changed: 48 additions & 44 deletions

File tree

.github/workflows/android-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Android CI
1818

1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121

2222
- name: Temp Environment Variable
2323
run: mkdir temp

.github/workflows/freebsd-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
TEMP: ${{github.workspace}}/temp
1818

1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121
- name: Temp Environment Variable
2222
run: |
2323
mkdir -p ${{github.workspace}}/temp
@@ -52,7 +52,7 @@ jobs:
5252
cmake --install ${{github.workspace}}/build
5353
tar cvf SonivoxV4.tar SonivoxV4
5454
55-
- uses: actions/upload-artifact@v4
55+
- uses: actions/upload-artifact@v6
5656
with:
5757
name: SonivoxV4-freebsd
5858
path: SonivoxV4.tar

.github/workflows/linux-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
name: 🚧${{ matrix.icon }} Linux CI ${{ matrix.arch }} format ${{ matrix.format }}
3232

3333
steps:
34-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v6
3535

3636
- name: '${{ matrix.icon }} Preparation'
3737
run: sudo apt install libgtest-dev
@@ -67,7 +67,7 @@ jobs:
6767
tar cvf SonivoxV4.tar SonivoxV4
6868
6969
- name: '${{ matrix.icon }} Upload Artifacts'
70-
uses: actions/upload-artifact@v4
70+
uses: actions/upload-artifact@v6
7171
with:
7272
name: SonivoxV4-Linux-${{matrix.arch}}-${{matrix.format}}
7373
path: SonivoxV4.tar

.github/workflows/mac-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
name: macOS CI
1919

2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2222

2323
- name: Temp Environment Variable
2424
run: |
@@ -51,7 +51,7 @@ jobs:
5151
tar cvf SonivoxV4.tar SonivoxV4
5252
5353
- name: Upload Artifacts
54-
uses: actions/upload-artifact@v4
54+
uses: actions/upload-artifact@v6
5555
with:
5656
name: SonivoxV4-macos
5757
path: SonivoxV4.tar

.github/workflows/win-msvc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
name: 🚧${{ matrix.icon }} msvc ${{ matrix.arch }}
2525

2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v6
2828

2929
- name: '${{ matrix.icon }} Install NSIS'
3030
uses: repolevedavaj/install-nsis@v1.1.0
@@ -68,15 +68,15 @@ jobs:
6868
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
6969

7070
- name: '${{ matrix.icon }} Upload Artifacts'
71-
uses: actions/upload-artifact@v4
71+
uses: actions/upload-artifact@v6
7272
with:
7373
name: SonivoxV4-msvc-${{matrix.arch}}
7474
path: ${{env.INSTALL_LOCATION}}
7575
retention-days: 90
7676
overwrite: true
7777

7878
- name: '${{ matrix.icon }} Upload Installer'
79-
uses: actions/upload-artifact@v4
79+
uses: actions/upload-artifact@v6
8080
with:
8181
name: SonivoxV4-msvc-installer-${{matrix.arch}}
8282
path: ${{github.workspace}}/build/sonivox-4.0.0-${{matrix.arch}}.exe

.github/workflows/win-msys2.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
shell: msys2 {0}
3131

3232
steps:
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v6
3434

3535
- name: '${{ matrix.icon }} Install NSIS'
3636
uses: repolevedavaj/install-nsis@v1.1.0
@@ -89,15 +89,15 @@ jobs:
8989
run: tar cvf ${{env.INSTALL_LOCATION}}.tar ${{env.INSTALL_LOCATION}}
9090

9191
- name: '${{ matrix.icon }} Upload Artifacts'
92-
uses: actions/upload-artifact@v4
92+
uses: actions/upload-artifact@v6
9393
with:
9494
name: ${{env.INSTALL_LOCATION}}-msys2-${{matrix.sys}}
9595
path: ${{env.INSTALL_LOCATION}}.tar
9696
retention-days: 90
9797
overwrite: true
9898

9999
- name: '${{ matrix.icon }} Upload Installer'
100-
uses: actions/upload-artifact@v4
100+
uses: actions/upload-artifact@v6
101101
with:
102102
name: SonivoxV4-msys2-installer-${{matrix.sys}}
103103
path: ${{github.workspace}}/build/sonivox-4.0.0-${{matrix.sys}}.exe

test/SonivoxTest.cpp

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -159,30 +159,30 @@ class SonivoxTest : public ::testing::TestWithParam<tuple</*fileName*/ string,
159159
<< mEASConfig->mixBufferSize * mEASConfig->numChannels;
160160
}
161161

162-
virtual void TearDown() override
163-
{
164-
EAS_RESULT result;
165-
if (mEASDataHandle) {
166-
if (mEASStreamHandle) {
167-
result = EAS_CloseFile(mEASDataHandle, mEASStreamHandle);
168-
ASSERT_EQ(result, EAS_SUCCESS) << "Failed to close audio file/stream";
169-
}
170-
result = EAS_Shutdown(mEASDataHandle);
171-
ASSERT_EQ(result, EAS_SUCCESS)
172-
<< "Failed to deallocate the resources for synthesizer library";
173-
}
174-
}
162+
virtual void TearDown() override
163+
{
164+
EAS_RESULT result;
165+
if (mEASDataHandle) {
166+
if (mEASStreamHandle) {
167+
result = EAS_CloseFile(mEASDataHandle, mEASStreamHandle);
168+
ASSERT_EQ(result, EAS_SUCCESS) << "Failed to close audio file/stream";
169+
}
170+
result = EAS_Shutdown(mEASDataHandle);
171+
ASSERT_EQ(result, EAS_SUCCESS)
172+
<< "Failed to deallocate the resources for synthesizer library";
173+
}
174+
}
175175

176176
bool seekToLocation(EAS_I32);
177177
bool renderAudio();
178178

179179
string mInputMediaFile;
180180
string mSoundFont;
181-
uint32_t mAudioplayTimeMs;
182-
uint32_t mTotalAudioChannels;
183-
uint32_t mAudioSampleRate;
181+
uint32_t mAudioplayTimeMs{0};
182+
uint32_t mTotalAudioChannels{0};
183+
uint32_t mAudioSampleRate{0};
184184
off64_t mBase;
185-
int64_t mLength;
185+
int64_t mLength{0};
186186
int mFd;
187187

188188
EAS_DATA_HANDLE mEASDataHandle;
@@ -354,21 +354,25 @@ TEST_P(SonivoxTest, DecodePauseResumeTest) {
354354
ASSERT_EQ(state, EAS_STATE_PLAY) << "Invalid state reached when resumed";
355355
}
356356

357-
INSTANTIATE_TEST_SUITE_P(SonivoxTestAll,
357+
INSTANTIATE_TEST_SUITE_P(SonivoxTest1,
358+
SonivoxTest,
359+
::testing::Values(make_tuple("test.mid", 2400, ""),
360+
make_tuple("ants.mid", 17233, "")));
361+
362+
#if defined(_XMF_PARSER)
363+
INSTANTIATE_TEST_SUITE_P(SonivoxTest2,
358364
SonivoxTest,
359-
::testing::Values(make_tuple("midi_a.mid", 2000, ""),
360-
make_tuple("midi8sec.mid", 8002, ""),
361-
make_tuple("midi_cs.mid", 2000, ""),
362-
make_tuple("midi_gs.mid", 2000, ""),
363-
make_tuple("ants.mid", 17233, ""),
364-
make_tuple("testmxmf.mxmf", 29095, ""),
365-
make_tuple("midi_a.mid", 2000, "soundfont.dls"),
366-
make_tuple("midi8sec.mid", 8002, "soundfont.dls"),
367-
make_tuple("midi_cs.mid", 2000, "soundfont.dls"),
368-
make_tuple("midi_gs.mid", 2000, "soundfont.dls"),
369-
make_tuple("ants.mid", 17233, "soundfont.dls")));
370-
371-
int main(int argc, char **argv) {
365+
::testing::Values(make_tuple("testmxmf.mxmf", 29095, "")));
366+
#endif
367+
368+
#if defined(DLS_SYNTHESIZER)
369+
INSTANTIATE_TEST_SUITE_P(SonivoxTest3,
370+
SonivoxTest,
371+
::testing::Values(make_tuple("test.mid", 2400, "soundfont.dls")));
372+
#endif
373+
374+
int main(int argc, char **argv)
375+
{
372376
gEnv = new SonivoxTestEnvironment();
373377
::testing::AddGlobalTestEnvironment(gEnv);
374378
::testing::InitGoogleTest(&argc, argv);

test/res/test.mid

175 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)