changeset 36:20a9fcbc2f5f

More on tests, remove debug output
author Chris Cannam
date Wed, 26 Nov 2014 13:52:15 +0000
parents 24eedd23a812
children fd249e29a721
files PyPluginObject.cpp test_plugin_metadata.py vampyhost.cpp
diffstat 3 files changed, 22 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/PyPluginObject.cpp	Wed Nov 26 13:45:25 2014 +0000
+++ b/PyPluginObject.cpp	Wed Nov 26 13:52:15 2014 +0000
@@ -63,8 +63,6 @@
 PyPluginObject *
 getPluginObject(PyObject *pyPluginHandle)
 {
-    cerr << "getPluginObject" << endl;
-
     PyPluginObject *pd = 0;
     if (PyPlugin_Check(pyPluginHandle)) {
         pd = (PyPluginObject *)pyPluginHandle;
@@ -208,7 +206,6 @@
 static void
 PyPluginObject_dealloc(PyPluginObject *self)
 {
-    cerr << "PyPluginObject_dealloc" << endl;
     delete self->plugin;
     PyObject_Del(self);
 }
@@ -216,8 +213,6 @@
 static PyObject *
 vampyhost_initialise(PyObject *self, PyObject *args)
 {
-    cerr << "vampyhost_initialise" << endl;
-    
     size_t channels, blockSize, stepSize;
 
     if (!PyArg_ParseTuple (args, "nnn",
@@ -251,8 +246,6 @@
 static PyObject *
 vampyhost_reset(PyObject *self, PyObject *)
 {
-    cerr << "vampyhost_reset" << endl;
-    
     PyPluginObject *pd = getPluginObject(self);
     if (!pd) return 0;
 
@@ -269,8 +262,6 @@
 static PyObject *
 vampyhost_getParameter(PyObject *self, PyObject *args)
 {
-    cerr << "vampyhost_getParameter" << endl;
-
     PyObject *pyParam;
 
     if (!PyArg_ParseTuple(args, "S", &pyParam)) {
@@ -288,8 +279,6 @@
 static PyObject *
 vampyhost_setParameter(PyObject *self, PyObject *args)
 {
-    cerr << "vampyhost_setParameter" << endl;
-
     PyObject *pyParam;
     float value;
 
@@ -359,8 +348,6 @@
 static PyObject *
 vampyhost_process(PyObject *self, PyObject *args)
 {
-    cerr << "vampyhost_process" << endl;
-
     PyObject *pyBuffer;
     PyObject *pyRealTime;
 
@@ -428,8 +415,6 @@
 static PyObject *
 vampyhost_getRemainingFeatures(PyObject *self, PyObject *)
 {
-    cerr << "vampyhost_getRemainingFeatures" << endl;
-
     PyPluginObject *pd = getPluginObject(self);
     if (!pd) return 0;
 
@@ -447,8 +432,6 @@
 static PyObject *
 vampyhost_unload(PyObject *self, PyObject *)
 {
-    cerr << "vampyhost_unloadPlugin" << endl;
-    
     PyPluginObject *pd = getPluginObject(self);
     if (!pd) return 0;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test_plugin_metadata.py	Wed Nov 26 13:52:15 2014 +0000
@@ -0,0 +1,20 @@
+
+import vampyhost as vh
+
+testPluginKey = "vamp-test-plugin:vamp-test-plugin"
+
+rate = 44100
+
+def test_inputdomain():
+    plug = vh.loadPlugin(testPluginKey, rate)
+    assert(plug.inputDomain == vh.TimeDomain)
+
+def test_info():
+    plug = vh.loadPlugin(testPluginKey, rate)
+    assert(plug.info["identifier"] == "vamp-test-plugin")
+    
+def test_parameterdescriptors():
+    plug = vh.loadPlugin(testPluginKey, rate)
+    assert(plug.parameters[0]["identifier"] == "produce_output")
+
+    
--- a/vampyhost.cpp	Wed Nov 26 13:45:25 2014 +0000
+++ b/vampyhost.cpp	Wed Nov 26 13:52:15 2014 +0000
@@ -70,8 +70,6 @@
 static PyObject *
 vampyhost_enumeratePlugins(PyObject *self, PyObject *)
 {
-    cerr << "vampyhost_enumeratePlugins" << endl;
-
     PluginLoader *loader = PluginLoader::getInstance();
     vector<PluginLoader::PluginKey> plugins = loader->listPlugins();
     VectorConversion conv;
@@ -81,8 +79,6 @@
 static PyObject *
 vampyhost_getPluginPath(PyObject *self, PyObject *)
 {
-    cerr << "vampyhost_getPluginPath" << endl;
-
     vector<string> path = PluginHostAdapter::getPluginPath();
     VectorConversion conv;
     return conv.PyValue_From_StringVector(path);
@@ -90,12 +86,10 @@
 
 static string toPluginKey(PyObject *pyPluginKey)
 {
-    cerr << "toPluginKey" << endl;
-
-    //convert to stl string
+    // convert to stl string
     string pluginKey(PyString_AS_STRING(pyPluginKey));
 
-    //check pluginKey Validity
+    // check pluginKey validity
     string::size_type ki = pluginKey.find(':');
     if (ki == string::npos) {
 	PyErr_SetString(PyExc_TypeError,
@@ -109,8 +103,6 @@
 static PyObject *
 vampyhost_getLibraryFor(PyObject *self, PyObject *args)
 {
-    cerr << "vampyhost_getLibraryFor" << endl;
-
     PyObject *pyPluginKey;
 
     if (!PyArg_ParseTuple(args, "S", &pyPluginKey)) {
@@ -130,8 +122,6 @@
 static PyObject *
 vampyhost_getPluginCategory(PyObject *self, PyObject *args)
 {
-    cerr << "vampyhost_getPluginCategory" << endl;
-
     PyObject *pyPluginKey;
 
     if (!PyArg_ParseTuple(args, "S", &pyPluginKey)) {
@@ -153,8 +143,6 @@
 static PyObject *
 vampyhost_getOutputList(PyObject *self, PyObject *args)
 {
-    cerr << "vampyhost_getOutputList" << endl;
-
     PyObject *pyPluginKey;
 
     if (!PyArg_ParseTuple(args, "S", &pyPluginKey)) {
@@ -193,8 +181,6 @@
 static PyObject *
 vampyhost_loadPlugin(PyObject *self, PyObject *args)
 {
-    cerr << "vampyhost_loadPlugin" << endl;
-
     PyObject *pyPluginKey;
     float inputSampleRate;