comparison TestDefaults.cpp @ 8:3019cb6b538d

* Add nondeterministic and verbose options to control output * Dump returned features in a few more situations, if verbose is set * Dump features to stdout rather than stderr
author cannam
date Wed, 18 Mar 2009 10:51:30 +0000
parents 43eb3a4b95c8
children 0c1c60654125
comparison
equal deleted inserted replaced
7:43eb3a4b95c8 8:3019cb6b538d
58 TestLengthyConstructor::m_registrar("E3 Lengthy constructor"); 58 TestLengthyConstructor::m_registrar("E3 Lengthy constructor");
59 59
60 static const size_t _step = 1000; 60 static const size_t _step = 1000;
61 61
62 Test::Results 62 Test::Results
63 TestDefaultProgram::test(string key) 63 TestDefaultProgram::test(string key, Options options)
64 { 64 {
65 Plugin::FeatureSet f[2]; 65 Plugin::FeatureSet f[2];
66 int rate = 44100; 66 int rate = 44100;
67 Results r; 67 Results r;
68 float **data = 0; 68 float **data = 0;
89 appendFeatures(f[run], fs); 89 appendFeatures(f[run], fs);
90 } 90 }
91 if (data) destroyTestAudio(data, channels); 91 if (data) destroyTestAudio(data, channels);
92 92
93 if (!(f[0] == f[1])) { 93 if (!(f[0] == f[1])) {
94 Result res = warning("Explicitly setting current program to its supposed current value changes the results"); 94 string message = "Explicitly setting current program to its supposed current value changes the results";
95 dump(res, f[0], f[1]); 95 Result res;
96 if (options & NonDeterministic) res = note(message);
97 else res = error(message);
98 if (options & Verbose) dump(res, f[0], f[1]);
96 r.push_back(res); 99 r.push_back(res);
97 } else { 100 } else {
98 r.push_back(success()); 101 r.push_back(success());
99 } 102 }
100 103
101 return r; 104 return r;
102 } 105 }
103 106
104 Test::Results 107 Test::Results
105 TestDefaultParameters::test(string key) 108 TestDefaultParameters::test(string key, Options options)
106 { 109 {
107 Plugin::FeatureSet f[2]; 110 Plugin::FeatureSet f[2];
108 int rate = 44100; 111 int rate = 44100;
109 Results r; 112 Results r;
110 float **data = 0; 113 float **data = 0;
137 appendFeatures(f[run], fs); 140 appendFeatures(f[run], fs);
138 } 141 }
139 if (data) destroyTestAudio(data, channels); 142 if (data) destroyTestAudio(data, channels);
140 143
141 if (!(f[0] == f[1])) { 144 if (!(f[0] == f[1])) {
142 Result res = warning("Explicitly setting parameters to their supposed default values changes the results"); 145 string message = "Explicitly setting parameters to their supposed default values changes the results";
143 dump(res, f[0], f[1]); 146 Result res;
147 if (options & NonDeterministic) res = note(message);
148 else res = error(message);
149 if (options & Verbose) dump(res, f[0], f[1]);
144 r.push_back(res); 150 r.push_back(res);
145 } else { 151 } else {
146 r.push_back(success()); 152 r.push_back(success());
147 } 153 }
148 154
149 return r; 155 return r;
150 } 156 }
151 157
152 Test::Results 158 Test::Results
153 TestLengthyConstructor::test(string key) 159 TestLengthyConstructor::test(string key, Options options)
154 { 160 {
155 time_t t0 = time(0); 161 time_t t0 = time(0);
156 auto_ptr<Plugin> p(load(key)); 162 auto_ptr<Plugin> p(load(key));
157 time_t t1 = time(0); 163 time_t t1 = time(0);
158 Results r; 164 Results r;