Skip to content

Commit

Permalink
debug failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksiy-Yakovenko committed Jul 17, 2024
1 parent e3f6661 commit 24a35b7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 96 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/linuxbuild.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,3 @@ jobs:
xcode-version: '14'
- name: Build for macOS
run: TRAVIS_OS_NAME=osx travis/build.sh
- name: Upload for macOS
env:
gh_ed25519_key: ${{ secrets.GH_ENCRYPTED_ED25519_KEY }}
gh_ed25519_iv: ${{ secrets.GH_ENCRYPTED_ED25519_IV }}
run: TRAVIS_OS_NAME=osx travis/upload.sh
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: mac
path: osx/build/Release/*.zip
37 changes: 0 additions & 37 deletions .github/workflows/windowsbuild.yml

This file was deleted.

15 changes: 11 additions & 4 deletions Tests/MP3DecoderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ static void runMp3TwoPieceTestWithBackend(int backend) {
char path[PATH_MAX];
snprintf (path, sizeof (path), "%s/TestData/chirp-1sec.mp3", dbplugindir);

printf("test file path: %s\n", dbplugindir);

playlist_t *plt = plt_alloc ("testplt");

DB_playItem_t *it = deadbeef->plt_insert_file2 (0, (ddb_playlist_t *)plt, NULL, path, NULL, NULL, NULL);


DB_decoder_t *dec = (DB_decoder_t *)deadbeef->plug_get_for_id ("stdmpg");

DB_fileinfo_t *fi = dec->open (0);
Expand All @@ -50,6 +51,7 @@ static void runMp3TwoPieceTestWithBackend(int backend) {

// request twice as much to make sure we don't overshoot
int res = dec->read (fi, buffer, (int)size*2);
printf("res[1]: %d\n", res);

EXPECT_EQ(res, size);

Expand All @@ -59,10 +61,12 @@ static void runMp3TwoPieceTestWithBackend(int backend) {
dec->seek_sample (fi, 0);

res = dec->read (fi, buffer2, (int)size/2);
printf("res[2]: %d\n", res);
EXPECT_EQ(res, size/2);

dec->seek_sample (fi, 44100/2);
res = dec->read (fi, buffer2+size/2, (int)size);
printf("res[3]: %d\n", res);
EXPECT_EQ(res, size/2);

#if 0
Expand All @@ -75,12 +79,15 @@ static void runMp3TwoPieceTestWithBackend(int backend) {
#endif

int cmp1 = memcmp (buffer, buffer2, size/2);
EXPECT_TRUE(cmp1==0);
printf("cmp1: %d\n", cmp1);
EXPECT_EQ(cmp1, 0);

int cmp2 = memcmp (buffer+size/2, buffer2+size/2, size/2);
EXPECT_TRUE(cmp2==0);
printf("cmp2: %d\n", cmp1);
EXPECT_EQ(cmp2, 0);

int cmp = memcmp (buffer, buffer2, size);
printf("cmp: %d\n", cmp1);

free (buffer);
free (buffer2);
Expand All @@ -89,7 +96,7 @@ static void runMp3TwoPieceTestWithBackend(int backend) {

deadbeef->plt_unref ((ddb_playlist_t *)plt);

EXPECT_TRUE(cmp==0);
EXPECT_EQ(cmp, 0);
}

TEST_F(MP3DecoderTests, test_DecodeMP3As2PiecesMPG123_SameAs1Piece) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
Expand Down
3 changes: 0 additions & 3 deletions travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ case "$TRAVIS_OS_NAME" in
rev=`git rev-parse --short HEAD`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $rev" plugins/cocoaui/deadbeef-Info.plist
xcodebuild "MACOSX_DEPLOYMENT_TARGET=10.13" test -project osx/deadbeef.xcodeproj -scheme deadbeef -configuration Release | xcpretty -t ; test ${PIPESTATUS[0]} -eq 0
xcodebuild "MACOSX_DEPLOYMENT_TARGET=10.13" -project osx/deadbeef.xcodeproj -target DeaDBeeF -configuration Release -quiet | xcpretty ; test ${PIPESTATUS[0]} -eq 0
cd osx/build/Release
zip -r deadbeef-$VERSION-macos-universal.zip DeaDBeeF.app
cd ../../..
;;
windows)
Expand Down

0 comments on commit 24a35b7

Please sign in to comment.