mirror of
https://github.com/fmang/opustags.git
synced 2025-07-12 20:15:39 +02:00
ogg decoding test, along with an opus sample
This commit is contained in:
25
tests/ogg_test.cc
Normal file
25
tests/ogg_test.cc
Normal 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
BIN
tests/samples/mystery.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user