test_cfs
========

Test module for the Compressed File Store (CFS) codec and page-level
compression/decompression API.

This extension exposes a single SQL-callable function:

  cfs_run_tests(OUT test_name text, OUT result text, OUT detail text)
    RETURNS SETOF record

It exercises the CFS codec subsystem and returns one row per test case:

  - raw_codec_roundtrip         - RAW pass-through compress/decompress
  - lz4_codec_roundtrip         - LZ4 round-trip (skipped if not compiled in)
  - zstd_codec_roundtrip        - Zstd round-trip (skipped if not compiled in)
  - compress_page_lz4           - CfsCompressPage/CfsDecompressPage with LZ4
  - incompressible_raw_fallback - incompressible data stored as RAW
  - crc_corruption_detection    - header CRC mismatch is detected
  - scratch_and_alignment       - scratch size and alignment macros

The "result" column is "ok", "skip" (codec not compiled in) or "fail".
A "skip" is never a failure; the regression test asserts zero failures.

Building
--------

The module is built as part of the test suite.  When the server is built
with LZ4/Zstd (--with-lz4 / --with-zstd) the corresponding codecs are
exercised; otherwise those cases are skipped gracefully.

Running
-------

  make installcheck-world      # or, from a configured tree:

  CREATE EXTENSION test_cfs;
  SELECT * FROM cfs_run_tests() ORDER BY test_name;
