diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-video-audio-recording--build-audio-command.el | 13 | ||||
| -rw-r--r-- | tests/test-video-audio-recording-command-structure.el | 6 | ||||
| -rw-r--r-- | tests/test-video-audio-recording-ffmpeg-functions.el | 6 |
3 files changed, 14 insertions, 11 deletions
diff --git a/tests/test-video-audio-recording--build-audio-command.el b/tests/test-video-audio-recording--build-audio-command.el index 54e5f56c..9577899b 100644 --- a/tests/test-video-audio-recording--build-audio-command.el +++ b/tests/test-video-audio-recording--build-audio-command.el @@ -3,8 +3,8 @@ ;;; Commentary: ;; Unit tests for cj/recording--build-audio-command. ;; Verifies correct ffmpeg command construction for audio-only recording -;; (mic + system monitor mixed to M4A/AAC), including shell quoting of -;; device names and output paths. +;; (mic + system monitor mixed to lossless FLAC), including shell quoting +;; of device names and output paths. ;;; Code: @@ -19,14 +19,17 @@ ;;; Normal Cases (ert-deftest test-video-audio-recording--build-audio-command-normal-uses-ffmpeg-pulse () - "Normal: audio command uses ffmpeg with two PulseAudio inputs mixed to AAC." + "Normal: audio command uses ffmpeg with two PulseAudio inputs mixed to FLAC." (let ((cj/recording-mic-boost 2.0) (cj/recording-system-volume 1.0)) - (let ((cmd (cj/recording--build-audio-command "mic" "sys" "/tmp/out.m4a"))) + (let ((cmd (cj/recording--build-audio-command "mic" "sys" "/tmp/out.flac"))) (should (string-match-p "ffmpeg" cmd)) (should (string-match-p "-f pulse -i" cmd)) (should (string-match-p "amix=inputs=2" cmd)) - (should (string-match-p "-c:a aac" cmd))))) + (should (string-match-p "-c:a flac" cmd)) + ;; Lossless: no lossy bitrate cap should be emitted. + (should-not (string-match-p "-b:a" cmd)) + (should-not (string-match-p "-c:a aac" cmd))))) (ert-deftest test-video-audio-recording--build-audio-command-normal-devices-in-command () "Normal: both mic and system device names appear in the command." diff --git a/tests/test-video-audio-recording-command-structure.el b/tests/test-video-audio-recording-command-structure.el index f4c24c39..41bd3b6a 100644 --- a/tests/test-video-audio-recording-command-structure.el +++ b/tests/test-video-audio-recording-command-structure.el @@ -260,8 +260,8 @@ (should (string-match-p "-f pulse" command)))) (test-command-structure-teardown))) -(ert-deftest test-audio-recording-command-outputs-m4a () - "Test that audio recording outputs to .m4a file." +(ert-deftest test-audio-recording-command-outputs-flac () + "Test that audio recording outputs to .flac file." (test-command-structure-setup) (unwind-protect (let ((command nil)) @@ -272,7 +272,7 @@ ((symbol-function 'cj/recording--validate-system-audio) (lambda () nil))) (cj/ffmpeg-record-audio audio-recordings-dir) - (should (string-match-p "\\.m4a" command)))) + (should (string-match-p "\\.flac" command)))) (test-command-structure-teardown))) ;;; Common Command Structure (Both Video and Audio) diff --git a/tests/test-video-audio-recording-ffmpeg-functions.el b/tests/test-video-audio-recording-ffmpeg-functions.el index 4b3570a2..3a38d00a 100644 --- a/tests/test-video-audio-recording-ffmpeg-functions.el +++ b/tests/test-video-audio-recording-ffmpeg-functions.el @@ -164,8 +164,8 @@ (should update-called))) (test-ffmpeg-teardown))) -(ert-deftest test-video-audio-recording-ffmpeg-record-audio-normal-creates-m4a-file () - "Test that audio recording creates .m4a file." +(ert-deftest test-video-audio-recording-ffmpeg-record-audio-normal-creates-flac-file () + "Test that audio recording creates .flac file." (test-ffmpeg-setup) (unwind-protect (let ((command nil)) @@ -176,7 +176,7 @@ ((symbol-function 'cj/recording--validate-system-audio) (lambda () nil))) (cj/ffmpeg-record-audio audio-recordings-dir) - (should (string-match-p "\\.m4a" command)))) + (should (string-match-p "\\.flac" command)))) (test-ffmpeg-teardown))) ;;; Stop Functions - Normal Cases |
