ogg decoding test, along with an opus sample

This commit is contained in:
Frédéric Mangano
2016-03-01 15:49:04 +01:00
parent f941464c61
commit 4d9ee3bf88
2 changed files with 25 additions and 0 deletions

25
tests/ogg_test.cc Normal file
View File

@ -0,0 +1,25 @@
#include "ogg.h"
#include "catch.h"
#include <fstream>
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);
}
}
}
}

BIN
tests/samples/mystery.ogg Normal file

Binary file not shown.