<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-video-audio-recording-check-ffmpeg.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-06-21T07:19:08+00:00</updated>
<entry>
<title>test: make subr mocks variadic for native-comp, add arity meta-test</title>
<updated>2026-06-21T07:19:08+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-21T07:19:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=a249e415c7199e3d4698f1956687fa351296a357'/>
<id>urn:sha1:a249e415c7199e3d4698f1956687fa351296a357</id>
<content type='text'>
Re-enabling native-comp surfaced a suite-wide fragility. When a test redefines a C primitive (or a native-compiled function), native-comp routes native callers through a trampoline that calls the mock with the primitive's maximum arity. A fixed-arity mock narrower than the primitive then throws wrong-number-of-arguments, intermittently, as the eln-cache fills.

I swept every arity-narrow subr mock to append &amp;rest _ (188 sites, preserving any named args the body uses), and added tests/test-meta-subr-mock-arity.el, which fails make test on any subr mock too narrow for the primitive's arity. The rule isn't "never mock a subr". The suite mocks message and completing-read freely. It's "a subr mock must accept the primitive's arity."

Background, the three failure modes, and the research are in docs/native-comp-subr-mocking.org.
</content>
</entry>
<entry>
<title>Revert "checking in modified/removed tests and other misc changes"</title>
<updated>2025-11-14T08:35:00+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-14T08:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=cdc39acfe00d015c246ae9e33532ffc869dd08ce'/>
<id>urn:sha1:cdc39acfe00d015c246ae9e33532ffc869dd08ce</id>
<content type='text'>
This reverts commit d36afc3f277b9a4228eb7b2464ec4e503695b8d4.
</content>
</entry>
<entry>
<title>checking in modified/removed tests and other misc changes</title>
<updated>2025-11-14T08:31:16+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-14T08:31:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=d36afc3f277b9a4228eb7b2464ec4e503695b8d4'/>
<id>urn:sha1:d36afc3f277b9a4228eb7b2464ec4e503695b8d4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>test: Add comprehensive test suite for video-audio-recording module</title>
<updated>2025-11-03T21:26:11+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-03T21:26:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=28e66d111aa597949edc58c1deab28d2cc331bdf'/>
<id>urn:sha1:28e66d111aa597949edc58c1deab28d2cc331bdf</id>
<content type='text'>
Added 83 test cases across 9 test files with 100% pass rate, covering
device detection, parsing, grouping, and complete workflow integration.

## What Was Done

### Refactoring for Testability
- Extracted `cj/recording--parse-pactl-output` from `cj/recording-parse-sources`
- Separated parsing logic from shell command execution
- Enables testing with fixture data instead of live system calls

### Test Fixtures Created
- `pactl-output-normal.txt` - All device types (built-in, USB, Bluetooth)
- `pactl-output-empty.txt` - Empty output
- `pactl-output-single.txt` - Single device
- `pactl-output-monitors-only.txt` - Only monitor devices
- `pactl-output-inputs-only.txt` - Only input devices
- `pactl-output-malformed.txt` - Invalid/malformed output

### Unit Tests (8 files, 78 test cases)
1. **test-video-audio-recording-friendly-state.el** (10 tests)
   - State name conversion: SUSPENDED→Ready, RUNNING→Active

2. **test-video-audio-recording-parse-pactl-output.el** (14 tests)
   - Parse raw pactl output into structured data
   - Handle empty, malformed, and mixed valid/invalid input

3. **test-video-audio-recording-parse-sources.el** (6 tests)
   - Shell command wrapper testing with mocked output

4. **test-video-audio-recording-detect-mic-device.el** (13 tests)
   - Documents bugs: Returns ID numbers instead of device names
   - Doesn't filter monitors (legacy function, not actively used)

5. **test-video-audio-recording-detect-system-device.el** (13 tests)
   - Works correctly: Returns full device names
   - Tests monitor detection with various device types

6. **test-video-audio-recording-group-devices-by-hardware.el** (12 tests)
   - CRITICAL: Bluetooth MAC address normalization (colons vs underscores)
   - Device pairing logic (mic + monitor from same hardware)
   - Friendly name assignment
   - Filters incomplete devices

7. **test-video-audio-recording-check-ffmpeg.el** (3 tests)
   - ffmpeg availability detection

8. **test-video-audio-recording-get-devices.el** (7 tests)
   - Auto-detection fallback logic
   - Error handling for incomplete detection

### Integration Tests (1 file, 5 test cases)
9. **test-integration-recording-device-workflow.el** (5 tests)
   - Complete workflow: parse → group → friendly names
   - Bluetooth MAC normalization end-to-end
   - Incomplete device filtering across components
   - Malformed data graceful handling

## Key Testing Insights

### Bugs Documented
- `cj/recording-detect-mic-device` has bugs (returns IDs, doesn't filter monitors)
- These functions appear to be legacy code not used by main workflow
- Tests document current behavior to catch regressions if fixed

### Critical Features Validated
- **Bluetooth MAC normalization**: Input uses colons (00:1B:66:C0:91:6D),
  output uses underscores (00_1B_66_C0_91_6D), grouping normalizes correctly
- **Device pairing**: Only devices with BOTH mic and monitor are included
- **Friendly names**: USB/PCI/Bluetooth patterns correctly identified

### Test Coverage
- Normal cases: Valid inputs, typical workflows
- Boundary cases: Empty, single device, incomplete pairs
- Error cases: Malformed input, missing devices, partial detection

## Test Execution
All tests pass: 9/9 files, 83/83 test cases (100% pass rate)

```bash
make test-file FILE=test-video-audio-recording-*.el
# All pass individually

# Integration test also passes
make test-file FILE=test-integration-recording-device-workflow.el
```
</content>
</entry>
</feed>
