Mercurial > hg > vamp-plugin-tester
comparison TestOutputs.cpp @ 5:6a279da6fdd7
* Add tests for default programs & parameters, etc
author | cannam |
---|---|
date | Tue, 17 Mar 2009 17:46:25 +0000 |
parents | d8724c5a6d83 |
children | 3019cb6b538d |
comparison
equal
deleted
inserted
replaced
4:d8724c5a6d83 | 5:6a279da6fdd7 |
---|---|
83 appendFeatures(f, fs); | 83 appendFeatures(f, fs); |
84 if (data) destroyTestAudio(data, channels); | 84 if (data) destroyTestAudio(data, channels); |
85 | 85 |
86 std::set<int> used; | 86 std::set<int> used; |
87 Plugin::OutputList outputs = p->getOutputDescriptors(); | 87 Plugin::OutputList outputs = p->getOutputDescriptors(); |
88 for (Plugin::FeatureSet::const_iterator i = fs.begin(); | 88 for (Plugin::FeatureSet::const_iterator i = f.begin(); |
89 i != fs.end(); ++i) { | 89 i != f.end(); ++i) { |
90 int o = i->first; | 90 int o = i->first; |
91 used.insert(o); | 91 used.insert(o); |
92 if (o < 0 || o >= (int)outputs.size()) { | 92 if (o < 0 || o >= (int)outputs.size()) { |
93 r.push_back(error("Data returned on nonexistent output")); | 93 r.push_back(error("Data returned on nonexistent output")); |
94 } | 94 } |
131 Plugin::FeatureSet fs = p->getRemainingFeatures(); | 131 Plugin::FeatureSet fs = p->getRemainingFeatures(); |
132 appendFeatures(f, fs); | 132 appendFeatures(f, fs); |
133 if (data) destroyTestAudio(data, channels); | 133 if (data) destroyTestAudio(data, channels); |
134 | 134 |
135 Plugin::OutputList outputs = p->getOutputDescriptors(); | 135 Plugin::OutputList outputs = p->getOutputDescriptors(); |
136 for (Plugin::FeatureSet::const_iterator i = fs.begin(); | 136 for (Plugin::FeatureSet::const_iterator i = f.begin(); |
137 i != fs.end(); ++i) { | 137 i != f.end(); ++i) { |
138 const Plugin::OutputDescriptor &o = outputs[i->first]; | 138 const Plugin::OutputDescriptor &o = outputs[i->first]; |
139 const Plugin::FeatureList &fl = i->second; | 139 const Plugin::FeatureList &fl = i->second; |
140 for (int j = 0; j < (int)fl.size(); ++j) { | 140 for (int j = 0; j < (int)fl.size(); ++j) { |
141 const Plugin::Feature &f = fl[j]; | 141 const Plugin::Feature &fe = fl[j]; |
142 switch (o.sampleType) { | 142 switch (o.sampleType) { |
143 case Plugin::OutputDescriptor::OneSamplePerStep: | 143 case Plugin::OutputDescriptor::OneSamplePerStep: |
144 if (f.hasTimestamp) { | 144 if (fe.hasTimestamp) { |
145 r.push_back(note("Plugin returns features with timestamps on OneSamplePerStep output")); | 145 r.push_back(note("Plugin returns features with timestamps on OneSamplePerStep output")); |
146 } | 146 } |
147 if (f.hasDuration) { | 147 if (fe.hasDuration) { |
148 r.push_back(note("Plugin returns features with durations on OneSamplePerStep output")); | 148 r.push_back(note("Plugin returns features with durations on OneSamplePerStep output")); |
149 } | 149 } |
150 break; | 150 break; |
151 case Plugin::OutputDescriptor::FixedSampleRate: | 151 case Plugin::OutputDescriptor::FixedSampleRate: |
152 break; | 152 break; |
153 case Plugin::OutputDescriptor::VariableSampleRate: | 153 case Plugin::OutputDescriptor::VariableSampleRate: |
154 if (!f.hasTimestamp) { | 154 if (!fe.hasTimestamp) { |
155 r.push_back(error("Plugin returns features with no timestamps on VariableSampleRate output")); | 155 r.push_back(error("Plugin returns features with no timestamps on VariableSampleRate output")); |
156 } | 156 } |
157 break; | 157 break; |
158 } | 158 } |
159 } | 159 } |