/*
 * Copyright 2025 Collabora Ltd.
 * SPDX-License-Identifier: MIT
 */

#include <vorbis/vorbisfile.h>

#include <assert.h>
#include <errno.h>
#include <string.h>

int
main (__attribute__((unused)) int argc,
      __attribute__((unused)) char **argv)
{
    OggVorbis_File vf;
    int ret, saved_errno;

    errno = 0;
    ret = ov_fopen("/dev/null", &vf);
    saved_errno = errno;
    fprintf(stderr, "ov_fopen(/dev/null) -> %d, errno %d (%s)\n",
            ret, saved_errno, strerror(saved_errno));
    assert(ret == OV_ENOTVORBIS);
    ret = ov_clear(&vf);
    assert(ret == 0);
    return 0;
}
