| name | ffi-testing |
| description | Test changes to the TAV C, WASM, and C# FFI surfaces. Use when exported functions, handles, constants, ownership rules, errors, goldens, or consumer tests change under ffi/. |
| argument-hint | [c|wasm|csharp] [utils|snp|cose|caci] |
FFI testing
Treat each consumer suite as an external user of its public surface.
Required coverage
- Enumerate the complete changed public surface from its authoritative source:
- C:
ffi/include/tav/*.h
- WASM: exported items in
ffi/src/wasm_ffi
- C#: public types and members under
ffi/csharp/TeeAttestationVerification
- Exercise every matching function, property, enum member, and ownership
operation in the corresponding consumer suite.
- Assert behavior with known values or negative cases; successful invocation
alone is insufficient.
- Test owned handles, borrowed byte views, null/error behavior, and
out-parameter reset rules where applicable.
- Update goldens only alongside behavioral tests.
ABI constants
When constants change:
- Keep explicit test mappings between compiled Rust constants and their C
names. Compare values and exact name sets in both directions.
- For constants exposed in C#, keep explicit C-name-to-managed-name mappings.
Parse the public C header and compare values and exact member sets with the
reflected managed enum.
- Reject missing, extra, duplicate, or mismatched members. Do not update only
one side to make a test pass.
- Use named Rust constants in runtime logic and tests; do not repeat numeric
literals in match arms and equivalence tests.
- Keep function signatures, handle ownership, and boolean/layout checks outside
constant-equivalence tests.
Validation
Use half-machine concurrency for builds.
- Native Rust:
crypto_openssl
- C consumer: shared and static
- WASM consumer:
crypto_webcrypto
- C#:
python3 ffi/csharp/run_tests.py --configuration Release
- Repository: formatting, version sync, license headers, and
git diff --check