diff --git a/tests/ogg_test.cc b/tests/ogg_test.cc new file mode 100644 index 0000000..2473496 --- /dev/null +++ b/tests/ogg_test.cc @@ -0,0 +1,25 @@ +#include "ogg.h" +#include "catch.h" + +#include + +using namespace opustags; + +SCENARIO("decoding a single-stream file", "[ogg]") +{ + + GIVEN("an ogg::Decoder") { + std::ifstream src("../tests/samples/mystery.ogg"); + ogg::Decoder dec(src); + + WHEN("reading the first page") { + ogg::Stream *s = dec.read_page(); + THEN("the Opus header is ready") { + REQUIRE(s != nullptr); + REQUIRE(s->state == ogg::HEADER_READY); + REQUIRE(s->type == ogg::OPUS_STREAM); + } + } + } + +} diff --git a/tests/samples/mystery.ogg b/tests/samples/mystery.ogg new file mode 100644 index 0000000..9d899aa Binary files /dev/null and b/tests/samples/mystery.ogg differ