MCPcopy Create free account
hub / github.com/audacity/audacity / setUp

Method setUp

tests/SimpleBlockFileTest.cpp:28–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 }
27
28 void setUp() {
29 dataLen = 200000;
30
31 int16Data = new short[dataLen];
32 int24Data = new int[dataLen];
33 floatData = new float[dataLen];
34
35 int i;
36 int sign = 1;
37
38 for(i = 0; i < dataLen; i++)
39 {
40 sign *= -1;
41 // These have no significance, it's just random data
42 int16Data[i] = sign*(i*i);
43 int24Data[i] = sign*((i*i*i)%0x000FFFFF);
44 float j = (float) i;
45 floatData[i] = sign*j/((j*j)+1);
46 }
47
48 int16BlockFile = new SimpleBlockFile(wxFileName("/tmp/int16"),
49 (samplePtr)int16Data, dataLen,
50 int16Sample);
51 int24BlockFile = new SimpleBlockFile(wxFileName("/tmp/int24"),
52 (samplePtr)int24Data, dataLen,
53 int24Sample);
54 floatBlockFile = new SimpleBlockFile(wxFileName("/tmp/float"),
55 (samplePtr)floatData, dataLen,
56 floatSample);
57
58 }
59
60 void tearDown() {
61 delete [] int16Data;

Callers 1

mainFunction · 0.45

Calls 1

wxFileNameClass · 0.50

Tested by

no test coverage detected