MCPcopy Create free account
hub / github.com/LMMS/lmms / testLengthRespected

Method testLengthRespected

tests/src/tracks/AutomationTrackTest.cpp:111–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 6

getSongFunction · 0.85
addObjectMethod · 0.80
putValueMethod · 0.80
setProgressionTypeMethod · 0.45
changeLengthMethod · 0.45
automatedValuesAtMethod · 0.45

Tested by

no test coverage detected