From 5ac761979a3878746f022f188725fc3d3dfedc82 Mon Sep 17 00:00:00 2001 From: Denis Kokorin Date: Mon, 26 Aug 2024 15:41:43 +0300 Subject: [PATCH] Fix test on Windows --- .github/workflows/tests.yml | 5 ++++- .../java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cfe6499f..daca7665 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + os: + - ubuntu-latest + - macos-latest + - windows-latest fail-fast: false steps: diff --git a/src/test/java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java b/src/test/java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java index d6170aad..c1c99d44 100644 --- a/src/test/java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java +++ b/src/test/java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java @@ -561,11 +561,15 @@ public void testExceptionIsThrownIfFfmpegExitsWithError() { // FFmpeg 6+ assertEquals(3, e.getProcessErrorLogMessages().size()); assertEquals("[error] Error opening input file non_existent.mp4.", e.getProcessErrorLogMessages().get(1).message); + } else if ("Process execution has ended with non-zero status: -2. Check logs for detailed error message.".equals(e.getMessage())) { + // FFmpeg 7 + assertEquals(3, e.getProcessErrorLogMessages().size()); + assertEquals("[error] Error opening input file non_existent.mp4.", e.getProcessErrorLogMessages().get(1).message); } else if ("Process execution has ended with non-zero status: 1. Check logs for detailed error message.".equals(e.getMessage())) { assertEquals(1, e.getProcessErrorLogMessages().size()); assertEquals("[error] non_existent.mp4: No such file or directory", e.getProcessErrorLogMessages().get(0).message); } else { - fail("Unknown FFmpeg output format (update test code!)"); + fail("Unknown FFmpeg output format (update test code!): " + e.getMessage()); } return; }