Revision 53:86d8a699dfbe

View differences:

Test.cpp
175 175
    return true;
176 176
}
177 177

  
178
bool
179
Test::containsTimestamps(const Plugin::FeatureSet &b)
180
{
181
    for (Plugin::FeatureSet::const_iterator i = b.begin(); i != b.end(); ++i) {
182
        for (int j = 0; j < (int)i->second.size(); ++j) {
183
            if (i->second[j].values.empty()) continue;
184
            for (int k = 0; k < (int)i->second[j].values.size(); ++k) {
185
                if (i->second[j].hasTimestamp) {
186
                    return true;
187
                }
188
            }
189
        }
190
    }
191
    return false;
192
}
193

  
178 194
void
179 195
Test::dumpFeature(const Plugin::Feature &f, bool showValues)
180 196
{
Test.h
110 110

  
111 111
    bool allFeaturesValid(const Vamp::Plugin::FeatureSet &); // i.e. no NaN/inf
112 112

  
113
    bool containsTimestamps(const Vamp::Plugin::FeatureSet &);
114

  
113 115
    void dumpFeature(const Vamp::Plugin::Feature &, bool showValues);
114 116
    void dump(const Vamp::Plugin::FeatureSet &, bool showValues = true);
115 117
    void dumpTwo(const Result &r,
TestMultipleRuns.cpp
246 246
    if (data) destroyTestAudio(data, channels);
247 247

  
248 248
    if (f[0] == f[1]) {
249
        string message = "Consecutive runs with different starting timestamps produce the same result";
250 249
        Result res;
251
        if (options & NonDeterministic) res = note(message);
252
        else res = warning(message);
253
        if (options & Verbose) {
254
            cout << message << endl;
255
            dump(f[0], false);
250
        if (containsTimestamps(f[0])) {
251
            string message = "Consecutive runs with different starting timestamps produce the same result";
252
            if (options & NonDeterministic) {
253
                res = note(message);
254
            } else {
255
                res = warning(message);
256
            }
257
            if (options & Verbose) {
258
                cout << res.message() << endl;
259
                dump(f[0], false);
260
            }
261
        } else {
262
            res = note("Consecutive runs with different starting timestamps produce the same result (but result features contain no timestamps, so this is probably all right)");
256 263
        }
257 264
        r.push_back(res);
258 265
    } else {

Also available in: Unified diff