Revision 6:ba3c8cc649d3

View differences:

TestDefaults.cpp
46 46
using namespace std;
47 47

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

  
50 51
Tester::TestRegistrar<TestDefaultProgram>
51 52
TestDefaultProgram::m_registrar("E1 Inconsistent default program");
......
53 54
Tester::TestRegistrar<TestDefaultParameters>
54 55
TestDefaultParameters::m_registrar("E2 Inconsistent default parameters");
55 56

  
57
Tester::TestRegistrar<TestLengthyConstructor>
58
TestLengthyConstructor::m_registrar("E3 Lengthy constructor");
59

  
56 60
static const size_t _step = 1000;
57 61

  
58 62
Test::Results
......
140 144

  
141 145
    return r;
142 146
}
147

  
148
Test::Results
149
TestLengthyConstructor::test(string key)
150
{
151
    time_t t0 = time(0);
152
    auto_ptr<Plugin> p(load(key));
153
    time_t t1 = time(0);
154
    Results r;
155
    if (t1 - t0 > 1) r.push_back(warning("Constructor takes some time to run: work should be deferred to initialise?"));
156
    return r;
157
}
158

  
TestDefaults.h
63 63
    static Tester::TestRegistrar<TestDefaultParameters> m_registrar;
64 64
};
65 65

  
66
class TestLengthyConstructor : public Test
67
{
68
public:
69
    TestLengthyConstructor() : Test() { }
70
    Results test(std::string key);
71
    
72
protected:
73
    static Tester::TestRegistrar<TestLengthyConstructor> m_registrar;
74
};
66 75

  
67 76
#endif
Tester.cpp
113 113
      * Initial value of a parameter on plugin construction differs
114 114
        from its default value (i.e. plugin produces different
115 115
        results depending on whether parameter is set explicitly by
116
        host to default value or not)
116
        host to default value or not) - DONE
117 117
        
118 118
      * If a plugin reports any programs, selecting default program
119
        explicitly changes results (as for default parameters)
119
        explicitly changes results (as for default parameters) - DONE
120 120

  
121 121
      * Output feature does not hasTimestamp when output type is
122 122
        VariableSampleRate - DONE
......
124 124
      * Output feature hasTimestamp or hasDuration when output type is
125 125
        OneSamplePerStep (warning only, this is not an error) - DONE
126 126

  
127
      * Plugin fails gracelessly when constructed with "weird" sample
128
        rate or initialised with "wrong" step size, block size, or
129
        number of channels
130

  
131 127
      * Plugin returns features whose output numbers do not have
132 128
        a corresponding record in output descriptor list - DONE
133 129

  
......
136 132

  
137 133
      * Constructor takes a long time to run.  A fuzzy concept, but
138 134
        suggests that some work should have been deferred to
139
        initialise().  Warning only
135
        initialise().  Warning only - DONE
136

  
137
      * Plugin fails gracelessly when constructed with "weird" sample
138
        rate or initialised with "wrong" step size, block size, or
139
        number of channels
140 140

  
141 141
      Well, that's quite a lot of tests already.  What else?
142 142

  

Also available in: Unified diff