| 109 | } |
| 110 | |
| 111 | void testLengthRespected() |
| 112 | { |
| 113 | FloatModel model; |
| 114 | |
| 115 | auto song = Engine::getSong(); |
| 116 | AutomationTrack track(song); |
| 117 | |
| 118 | AutomationPattern p(&track); |
| 119 | p.setProgressionType(AutomationPattern::LinearProgression); |
| 120 | p.addObject(&model); |
| 121 | |
| 122 | p.putValue(0, 0.0, false); |
| 123 | p.putValue(100, 1.0, false); |
| 124 | |
| 125 | p.changeLength(100); |
| 126 | QCOMPARE(song->automatedValuesAt( 0)[&model], 0.0f); |
| 127 | QCOMPARE(song->automatedValuesAt( 50)[&model], 0.5f); |
| 128 | QCOMPARE(song->automatedValuesAt(100)[&model], 1.0f); |
| 129 | |
| 130 | p.changeLength(50); |
| 131 | QCOMPARE(song->automatedValuesAt( 0)[&model], 0.0f); |
| 132 | QCOMPARE(song->automatedValuesAt( 50)[&model], 0.5f); |
| 133 | QCOMPARE(song->automatedValuesAt(100)[&model], 0.5f); |
| 134 | } |
| 135 | |
| 136 | void testInlineAutomation() |
| 137 | { |
nothing calls this directly
no test coverage detected