MCPcopy Create free account
hub / github.com/christophhart/HISE / runTest

Method runTest

hi_scripting/scripting/scriptnode/api/TestClasses.cpp:175–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175juce::var ScriptNetworkTest::runTest()
176{
177 wb->triggerRecompile();
178 auto& td = wb->getTestData();
179
180 if (auto b = dynamic_cast<CHandler*>(wb->getCompileHandler()))
181 {
182 if (b->lastTestResult.wasOk() && !b->network->getExceptionHandler().isOk())
183 {
184 // A runtime error occured!
185 b->lastTestResult = Result::fail(b->network->getExceptionHandler().getErrorMessage());
186 }
187 }
188
189 auto numChannels = td.testOutputData.getNumChannels();
190
191 if (numChannels == 1)
192 {
193
194 auto v = new VariantBuffer(td.testOutputData.getNumSamples());
195 FloatVectorOperations::copy(v->buffer.getWritePointer(0), td.testOutputData.getReadPointer(0), v->size);
196 return var(v);
197 }
198 else
199 {
200 Array<var> channels;
201
202 for (int i = 0; i < numChannels; i++)
203 {
204 auto v = new VariantBuffer(td.testOutputData.getNumSamples());
205 FloatVectorOperations::copy(v->buffer.getWritePointer(0), td.testOutputData.getReadPointer(i), v->size);
206
207 channels.add(var(v));
208 }
209
210 return var(channels);
211 }
212}
213
214String ScriptNetworkTest::dumpNetworkAsXml()
215{

Callers 1

postCompileMethod · 0.45

Calls 14

varFunction · 0.85
triggerRecompileMethod · 0.80
getCompileHandlerMethod · 0.80
processTestDataMethod · 0.80
copyFunction · 0.50
wasOkMethod · 0.45
isOkMethod · 0.45
getErrorMessageMethod · 0.45
getNumChannelsMethod · 0.45
getNumSamplesMethod · 0.45
getWritePointerMethod · 0.45
getReadPointerMethod · 0.45

Tested by

no test coverage detected