From 05b5e0692898e0904b4106b61882b459acda08e4 Mon Sep 17 00:00:00 2001 From: Michael Helmling Date: Sat, 25 Feb 2012 18:32:00 +0100 Subject: [PATCH] added APE tag PropertyMap test --- tests/test_ape.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/test_ape.cpp b/tests/test_ape.cpp index c95ff0c2..e6c31405 100644 --- a/tests/test_ape.cpp +++ b/tests/test_ape.cpp @@ -5,6 +5,9 @@ #include #include #include +#include +#include +#include #include "utils.h" using namespace std; @@ -16,6 +19,7 @@ class TestAPE : public CppUnit::TestFixture CPPUNIT_TEST(testProperties399); CPPUNIT_TEST(testProperties396); CPPUNIT_TEST(testProperties390); + CPPUNIT_TEST(testPropertyinterface); CPPUNIT_TEST_SUITE_END(); public: @@ -47,6 +51,27 @@ public: CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate()); } + void testPropertyinterface() + { + APE::Tag tag; + APE::Item item1 = APE::Item("TRACK", "17"); + tag.setItem("TRACK", item1); + + APE::Item item2 = APE::Item(); + item2.setType(APE::Item::Binary); + tag.setItem("TESTBINARY", item2); + + PropertyMap properties = tag.properties(); + CPPUNIT_ASSERT_EQUAL(1u, properties.unsupportedData().size()); + CPPUNIT_ASSERT(properties.contains("TRACKNUMBER")); + CPPUNIT_ASSERT(!properties.contains("TRACK")); + CPPUNIT_ASSERT(tag.itemListMap().contains("TESTBINARY")); + + tag.removeUnsupportedProperties(properties.unsupportedData()); + CPPUNIT_ASSERT(!tag.itemListMap().contains("TESTBINARY")); + + } + }; CPPUNIT_TEST_SUITE_REGISTRATION(TestAPE); -- 2.40.0