mirror of
https://github.com/fmang/opustags.git
synced 2025-03-14 08:30:08 +01:00
tests: make style uniform
This commit is contained in:
parent
817ba5cba6
commit
0e2b1fec9c
@ -10,7 +10,7 @@
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
bool same_streams(ogg::Decoder &a, ogg::Decoder &b)
|
||||
static bool same_streams(ogg::Decoder &a, ogg::Decoder &b)
|
||||
{
|
||||
std::shared_ptr<ogg::Stream> sa, sb;
|
||||
ogg_packet pa, pb;
|
||||
@ -46,7 +46,7 @@ bool same_streams(ogg::Decoder &a, ogg::Decoder &b)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool same_files(std::istream &a, std::istream &b)
|
||||
static bool same_files(std::istream &a, std::istream &b)
|
||||
{
|
||||
static const size_t block = 1024;
|
||||
char ba[block], bb[block];
|
||||
|
@ -80,7 +80,7 @@ TEST_CASE("decoding a multi-stream file", "[ogg]")
|
||||
REQUIRE(s->state == ogg::TAGS_READY);
|
||||
}
|
||||
|
||||
void craft_stream(std::ostream &out, const std::string &tags_data)
|
||||
static void craft_stream(std::ostream &out, const std::string &tags_data)
|
||||
{
|
||||
ogg::Encoder enc(out);
|
||||
ogg_stream_state os;
|
||||
|
@ -41,7 +41,7 @@ template<typename T> static T *get_handler(
|
||||
return handler;
|
||||
}
|
||||
|
||||
TEST_CASE("Options parsing test")
|
||||
TEST_CASE("option parsing", "[options]")
|
||||
{
|
||||
SECTION("--help") {
|
||||
REQUIRE(retrieve_options({"--help"}).show_help);
|
||||
|
@ -43,7 +43,7 @@ bool DummyTagsHandler::done()
|
||||
return done_ret;
|
||||
}
|
||||
|
||||
TEST_CASE("Composite tags handler test")
|
||||
TEST_CASE("composite tags handler", "[tags_handlers]")
|
||||
{
|
||||
auto handler1 = std::make_shared<DummyTagsHandler>();
|
||||
auto handler2 = std::make_shared<DummyTagsHandler>();
|
||||
@ -51,7 +51,7 @@ TEST_CASE("Composite tags handler test")
|
||||
composite_handler.add_handler(handler1);
|
||||
composite_handler.add_handler(handler2);
|
||||
|
||||
SECTION("Relevance") {
|
||||
SECTION("relevance") {
|
||||
const int dummy_streamno = 1;
|
||||
handler1->relevant_ret = true;
|
||||
handler2->relevant_ret = true;
|
||||
@ -62,7 +62,7 @@ TEST_CASE("Composite tags handler test")
|
||||
REQUIRE(!composite_handler.relevant(dummy_streamno));
|
||||
}
|
||||
|
||||
SECTION("Listing") {
|
||||
SECTION("listing") {
|
||||
const int dummy_streamno = 1;
|
||||
Tags dummy_tags;
|
||||
REQUIRE(!handler1->list_fired);
|
||||
@ -72,7 +72,7 @@ TEST_CASE("Composite tags handler test")
|
||||
REQUIRE(handler2->list_fired);
|
||||
}
|
||||
|
||||
SECTION("Editing") {
|
||||
SECTION("editing") {
|
||||
const int dummy_streamno = 1;
|
||||
Tags dummy_tags;
|
||||
handler1->edit_ret = true;
|
||||
@ -84,7 +84,7 @@ TEST_CASE("Composite tags handler test")
|
||||
REQUIRE(!composite_handler.edit(dummy_streamno, dummy_tags));
|
||||
}
|
||||
|
||||
SECTION("Finish") {
|
||||
SECTION("finish") {
|
||||
handler1->done_ret = true;
|
||||
handler2->done_ret = true;
|
||||
REQUIRE(composite_handler.done());
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
TEST_CASE("Insertion tags handler test")
|
||||
TEST_CASE("insertion tags handler", "[tags_handlers]")
|
||||
{
|
||||
Tags tags;
|
||||
const auto streamno = 1;
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
TEST_CASE("Listing tags handler test")
|
||||
TEST_CASE("listing tags handler", "[tags_handlers]")
|
||||
{
|
||||
const auto streamno = 1;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
TEST_CASE("Modification tags handler test")
|
||||
TEST_CASE("modification tags handler", "[tags_handlers]")
|
||||
{
|
||||
const auto streamno = 1;
|
||||
const auto first_tag_key = "tag_key";
|
||||
|
@ -3,11 +3,11 @@
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
TEST_CASE("Removal tags handler test")
|
||||
TEST_CASE("removal tags handler", "[tags_handlers]")
|
||||
{
|
||||
const auto streamno = 1;
|
||||
|
||||
SECTION("Removing a single tag")
|
||||
SECTION("removing a single tag")
|
||||
{
|
||||
const auto expected_tag_key = "tag_key";
|
||||
const auto other_tag_key = "other_tag_key";
|
||||
@ -25,7 +25,7 @@ TEST_CASE("Removal tags handler test")
|
||||
REQUIRE_THROWS(handler.edit(streamno, tags));
|
||||
}
|
||||
|
||||
SECTION("Removing all tags")
|
||||
SECTION("removing all tags")
|
||||
{
|
||||
RemovalTagsHandler handler(streamno);
|
||||
|
||||
|
@ -35,20 +35,20 @@ bool DummyTagsHandler::edit_impl(Tags &)
|
||||
return true;
|
||||
}
|
||||
|
||||
TEST_CASE("Stream-based tags handler test")
|
||||
TEST_CASE("stream-based tags handler", "[tags_handlers]")
|
||||
{
|
||||
SECTION("Concrete stream") {
|
||||
SECTION("concrete stream") {
|
||||
const auto relevant_stream_number = 1;
|
||||
const auto irrelevant_stream_number = 2;
|
||||
Tags dummy_tags;
|
||||
DummyTagsHandler handler(relevant_stream_number);
|
||||
|
||||
SECTION("Relevance") {
|
||||
SECTION("relevance") {
|
||||
REQUIRE(!handler.relevant(irrelevant_stream_number));
|
||||
REQUIRE(handler.relevant(relevant_stream_number));
|
||||
}
|
||||
|
||||
SECTION("Listing") {
|
||||
SECTION("listing") {
|
||||
handler.list(irrelevant_stream_number, dummy_tags);
|
||||
REQUIRE(!handler.list_fired);
|
||||
handler.list(relevant_stream_number, dummy_tags);
|
||||
@ -62,14 +62,14 @@ TEST_CASE("Stream-based tags handler test")
|
||||
REQUIRE(handler.edit_fired);
|
||||
}
|
||||
|
||||
SECTION("Finish through listing") {
|
||||
SECTION("finish through listing") {
|
||||
REQUIRE(!handler.edit(irrelevant_stream_number, dummy_tags));
|
||||
REQUIRE(!handler.done());
|
||||
REQUIRE(handler.edit(relevant_stream_number, dummy_tags));
|
||||
REQUIRE(handler.done());
|
||||
}
|
||||
|
||||
SECTION("Finish through editing") {
|
||||
SECTION("finish through editing") {
|
||||
handler.list(irrelevant_stream_number, dummy_tags);
|
||||
REQUIRE(!handler.done());
|
||||
handler.list(relevant_stream_number, dummy_tags);
|
||||
@ -77,7 +77,7 @@ TEST_CASE("Stream-based tags handler test")
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("Any stream") {
|
||||
SECTION("any stream") {
|
||||
Tags dummy_tags;
|
||||
DummyTagsHandler handler(StreamTagsHandler::ALL_STREAMS);
|
||||
REQUIRE(handler.relevant(1));
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
TEST_CASE("Tag manipulation test", "[tags]")
|
||||
TEST_CASE("tag manipulation", "[tags]")
|
||||
{
|
||||
SECTION("Basic operations") {
|
||||
SECTION("basic operations") {
|
||||
Tags tags;
|
||||
REQUIRE(!tags.contains("a"));
|
||||
tags.add("a", "1");
|
||||
@ -16,7 +16,7 @@ TEST_CASE("Tag manipulation test", "[tags]")
|
||||
REQUIRE_THROWS(tags.get("a"));
|
||||
}
|
||||
|
||||
SECTION("Clearing") {
|
||||
SECTION("clearing") {
|
||||
Tags tags;
|
||||
tags.add("a", "1");
|
||||
tags.add("b", "2");
|
||||
@ -25,7 +25,7 @@ TEST_CASE("Tag manipulation test", "[tags]")
|
||||
REQUIRE(tags.get_all().empty());
|
||||
}
|
||||
|
||||
SECTION("Maintaing order of insertions") {
|
||||
SECTION("maintaing order of insertions") {
|
||||
Tags tags;
|
||||
tags.add("z", "1");
|
||||
tags.add("y", "2");
|
||||
@ -52,7 +52,7 @@ TEST_CASE("Tag manipulation test", "[tags]")
|
||||
REQUIRE(tags.get_all()[3].key == "gamma");
|
||||
}
|
||||
|
||||
SECTION("Key to multiple values") {
|
||||
SECTION("key to multiple values") {
|
||||
// ARTIST is set once per artist.
|
||||
// https://www.xiph.org/vorbis/doc/v-comment.html
|
||||
Tags tags;
|
||||
@ -61,7 +61,7 @@ TEST_CASE("Tag manipulation test", "[tags]")
|
||||
REQUIRE(tags.get_all().size() == 2);
|
||||
}
|
||||
|
||||
SECTION("Removing multivalues should remove all of them") {
|
||||
SECTION("removing multivalues should remove all of them") {
|
||||
Tags tags;
|
||||
tags.add("ARTIST", "You");
|
||||
tags.add("ARTIST", "Me");
|
||||
@ -69,13 +69,13 @@ TEST_CASE("Tag manipulation test", "[tags]")
|
||||
REQUIRE(tags.get_all().empty());
|
||||
}
|
||||
|
||||
SECTION("Raw set") {
|
||||
SECTION("raw set") {
|
||||
Tags tags;
|
||||
tags.add("TITLE=Foo=Bar");
|
||||
REQUIRE(tags.get("TITLE") == "Foo=Bar");
|
||||
}
|
||||
|
||||
SECTION("Case insensitiveness for keys") {
|
||||
SECTION("case insensitiveness for keys") {
|
||||
Tags tags;
|
||||
tags.add("TITLE", "Boop");
|
||||
REQUIRE(tags.get("title") == "Boop");
|
||||
|
Loading…
x
Reference in New Issue
Block a user