Revision 28:b1bc4d045a4b

View differences:

Test.cpp
46 46

  
47 47
#include <math.h>
48 48

  
49
#ifdef __SUNPRO_CC
50
#include <ieeefp.h>
51
#define isinf(x) (!finite(x))
52
#endif
53

  
49 54
Test::Test() { }
50 55
Test::~Test() { }
51 56

  
TestDefaults.cpp
48 48
#include <cmath>
49 49
#include <time.h>
50 50

  
51
#ifndef __GNUC__
52
#include <alloca.h>
53
#endif
54

  
51 55
Tester::TestRegistrar<TestDefaultProgram>
52 56
TestDefaultProgram::m_registrar("E1 Inconsistent default program");
53 57

  
......
75 79
        if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
76 80
        if (!data) data = createTestAudio(channels, _step, count);
77 81
        for (size_t i = 0; i < count; ++i) {
82
#ifdef __GNUC__
78 83
            float *ptr[channels];
84
#else
85
            float **ptr = (float **)alloca(channels * sizeof(float));
86
#endif
79 87
            size_t idx = i * _step;
80 88
            for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
81 89
            RealTime timestamp = RealTime::frame2RealTime(idx, rate);
......
131 139
        if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
132 140
        if (!data) data = createTestAudio(channels, _step, count);
133 141
        for (size_t i = 0; i < count; ++i) {
142
#ifdef __GNUC__
134 143
            float *ptr[channels];
144
#else
145
            float **ptr = (float **)alloca(channels * sizeof(float));
146
#endif
135 147
            size_t idx = i * _step;
136 148
            for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
137 149
            RealTime timestamp = RealTime::frame2RealTime(idx, rate);
TestInitialise.cpp
50 50

  
51 51
#include <cmath>
52 52

  
53
#ifndef __GNUC__
54
#include <alloca.h>
55
#endif
56

  
53 57
Tester::TestRegistrar<TestSampleRates>
54 58
TestSampleRates::m_registrar("F1 Different sample rates");
55 59

  
......
97 101

  
98 102
        data = createTestAudio(channels, _step, count);
99 103
        for (size_t i = 0; i < count; ++i) {
104
#ifdef __GNUC__
100 105
            float *ptr[channels];
106
#else
107
            float **ptr = (float **)alloca(channels * sizeof(float));
108
#endif
101 109
            size_t idx = i * _step;
102 110
            for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
103 111
            RealTime timestamp = RealTime::frame2RealTime(idx, rate);
TestMultipleRuns.cpp
47 47

  
48 48
#include <cmath>
49 49

  
50
#ifndef __GNUC__
51
#include <alloca.h>
52
#endif
53

  
50 54
Tester::TestRegistrar<TestDistinctRuns>
51 55
TestDistinctRuns::m_registrar("D1 Consecutive runs with separate instances");
52 56

  
......
76 80
        if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
77 81
        if (!data) data = createTestAudio(channels, _step, count);
78 82
        for (size_t i = 0; i < count; ++i) {
83
#ifdef __GNUC__
79 84
            float *ptr[channels];
85
#else
86
            float **ptr = (float **)alloca(channels * sizeof(float));
87
#endif
80 88
            size_t idx = i * _step;
81 89
            for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
82 90
            RealTime timestamp = RealTime::frame2RealTime(idx, rate);
......
119 127
        else if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
120 128
        if (!data) data = createTestAudio(channels, _step, count);
121 129
        for (size_t i = 0; i < count; ++i) {
130
#ifdef __GNUC__
122 131
            float *ptr[channels];
132
#else
133
            float **ptr = (float **)alloca(channels * sizeof(float));
134
#endif
123 135
            size_t idx = i * _step;
124 136
            for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
125 137
            RealTime timestamp = RealTime::frame2RealTime(idx, rate);
......
166 178
        if (!data) data = createTestAudio(channels, _step, count);
167 179
    }
168 180
    for (size_t i = 0; i < count; ++i) {
181
#ifdef __GNUC__
169 182
        float *ptr[channels];
183
#else
184
        float **ptr = (float **)alloca(channels * sizeof(float));
185
#endif
170 186
        size_t idx = i * _step;
171 187
        for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
172 188
        RealTime timestamp = RealTime::frame2RealTime(idx, rate);
......
212 228
        if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
213 229
        if (!data) data = createTestAudio(channels, _step, count);
214 230
        for (size_t i = 0; i < count; ++i) {
231
#ifdef __GNUC__
215 232
            float *ptr[channels];
233
#else
234
            float **ptr = (float **)alloca(channels * sizeof(float));
235
#endif
216 236
            size_t idx = i * _step;
217 237
            for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
218 238
            RealTime timestamp = RealTime::frame2RealTime(idx, rate);
TestOutputs.cpp
50 50

  
51 51
#include <cmath>
52 52

  
53
#ifndef __GNUC__
54
#include <alloca.h>
55
#endif
56

  
53 57
Tester::TestRegistrar<TestOutputNumbers>
54 58
TestOutputNumbers::m_registrar("B1 Output number mismatching");
55 59

  
......
72 76
    if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
73 77
    if (!data) data = createTestAudio(channels, _step, count);
74 78
    for (size_t i = 0; i < count; ++i) {
79
#ifdef __GNUC__
75 80
        float *ptr[channels];
81
#else
82
        float **ptr = (float **)alloca(channels * sizeof(float));
83
#endif
76 84
        size_t idx = i * _step;
77 85
        for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
78 86
        RealTime timestamp = RealTime::frame2RealTime(idx, rate);
......
122 130
    if (!initDefaults(p.get(), channels, step, block, r)) return r;
123 131
    if (!data) data = createTestAudio(channels, block, count);
124 132
    for (size_t i = 0; i < count; ++i) {
133
#ifdef __GNUC__
125 134
        float *ptr[channels];
135
#else
136
        float **ptr = (float **)alloca(channels * sizeof(float));
137
#endif
126 138
        size_t idx = i * step;
127 139
        for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
128 140
        RealTime timestamp = RealTime::frame2RealTime(idx, rate);

Also available in: Unified diff