# HG changeset patch # User Chris Cannam # Date 1402386654 -3600 # Node ID b700f37dc1181449a47eba01cc90a20f761d6bda # Parent a2d9aed55a2a62c319e18837625457a025fee9f7 Add test for .cat file diff -r a2d9aed55a2a -r b700f37dc118 TestStaticData.cpp --- a/TestStaticData.cpp Mon Dec 16 13:28:28 2013 +0000 +++ b/TestStaticData.cpp Tue Jun 10 08:50:54 2014 +0100 @@ -40,7 +40,9 @@ #include "TestStaticData.h" #include +#include using namespace Vamp; +using namespace Vamp::HostExt; #include using namespace std; @@ -56,6 +58,9 @@ Tester::TestRegistrar TestValueRanges::m_registrar("A3 Inappropriate value extents"); +Tester::TestRegistrar +TestCategory::m_registrar("A3 Missing category"); + Test::Results TestIdentifiers::test(string key, Options) { @@ -198,4 +203,18 @@ return r; } +Test::Results +TestCategory::test(string key, Options) +{ + PluginLoader::PluginCategoryHierarchy hierarchy = + PluginLoader::getInstance()->getPluginCategory(key); + + Results r; + if (hierarchy.empty()) { + r.push_back(warning("Plugin category missing or cannot be loaded (no .cat file?)")); + } + + return r; +} + diff -r a2d9aed55a2a -r b700f37dc118 TestStaticData.h --- a/TestStaticData.h Mon Dec 16 13:28:28 2013 +0000 +++ b/TestStaticData.h Tue Jun 10 08:50:54 2014 +0100 @@ -76,4 +76,14 @@ static Tester::TestRegistrar m_registrar; }; +class TestCategory : public Test +{ +public: + TestCategory() : Test() { } + Results test(std::string key, Options options); + +protected: + static Tester::TestRegistrar m_registrar; +}; + #endif