Changeset View
Changeset View
Standalone View
Standalone View
unittests/gcodetests.cpp
Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Line(s) | 177 | { | |||
---|---|---|---|---|---|
178 | QVERIFY(GCode::toString(GCode::G161) == QObject::tr("G161: Home axis to minimum")); | 178 | QVERIFY(GCode::toString(GCode::G161) == QObject::tr("G161: Home axis to minimum")); | ||
179 | } | 179 | } | ||
180 | 180 | | |||
181 | void GCodeTests::string_G162() | 181 | void GCodeTests::string_G162() | ||
182 | { | 182 | { | ||
183 | QVERIFY(GCode::toString(GCode::G162) == QObject::tr("G162: Home axis to maximum")); | 183 | QVERIFY(GCode::toString(GCode::G162) == QObject::tr("G162: Home axis to maximum")); | ||
184 | } | 184 | } | ||
185 | 185 | | |||
186 | void GCodeTests::command_M20() | ||||
187 | { | ||||
188 | QVERIFY(GCode::toCommand(GCode::M20) == QStringLiteral("M20")); | ||||
189 | } | ||||
190 | | ||||
191 | void GCodeTests::command_M21() | ||||
192 | { | ||||
193 | QVERIFY(GCode::toCommand(GCode::M21) == QStringLiteral("M21")); | ||||
194 | QVERIFY(GCode::toCommand(GCode::M21, QStringLiteral("2")) == QStringLiteral("M21 P2")); | ||||
195 | } | ||||
196 | | ||||
197 | void GCodeTests::command_M22() | ||||
198 | { | ||||
199 | QVERIFY(GCode::toCommand(GCode::M22) == QStringLiteral("M22")); | ||||
200 | QVERIFY(GCode::toCommand(GCode::M22, QStringLiteral("5")) == QStringLiteral("M22 P5")); | ||||
201 | } | ||||
202 | | ||||
203 | void GCodeTests::command_M23() | ||||
204 | { | ||||
205 | QVERIFY(GCode::toCommand(GCode::M23) == QStringLiteral("ERROR! M23: It's obligatory to have an argument")); | ||||
206 | QVERIFY(GCode::toCommand(GCode::M23, QStringLiteral("FileName")) == QStringLiteral("M23 FileName")); | ||||
207 | } | ||||
208 | | ||||
209 | void GCodeTests::command_M24() | ||||
210 | { | ||||
211 | QVERIFY(GCode::toCommand(GCode::M24) == QStringLiteral("M24")); | ||||
212 | } | ||||
213 | | ||||
214 | void GCodeTests::command_M25() | ||||
215 | { | ||||
216 | QVERIFY(GCode::toCommand(GCode::M25) == QStringLiteral("M25")); | ||||
217 | } | ||||
218 | | ||||
219 | void GCodeTests::command_M26() | ||||
220 | { | ||||
221 | QVERIFY(GCode::toCommand(GCode::M26) == QStringLiteral("ERROR! M26: It's obligatory to have an argument")); | ||||
222 | QVERIFY(GCode::toCommand(GCode::M26, QStringLiteral("15%")) == QStringLiteral("M26 P0.15")); | ||||
223 | QVERIFY(GCode::toCommand(GCode::M26, QStringLiteral("15")) == QStringLiteral("M26 S15")); | ||||
224 | | ||||
225 | } | ||||
226 | | ||||
227 | void GCodeTests::command_M27() | ||||
228 | { | ||||
229 | QVERIFY(GCode::toCommand(GCode::M27) == QStringLiteral("M27")); | ||||
230 | } | ||||
231 | | ||||
232 | void GCodeTests::command_M28() | ||||
233 | { | ||||
234 | QVERIFY(GCode::toCommand(GCode::M28) == QStringLiteral("ERROR! M28: It's obligatory to have an argument")); | ||||
235 | QVERIFY(GCode::toCommand(GCode::M28, QStringLiteral("FileName")) == QStringLiteral("M28 FileName")); | ||||
236 | } | ||||
237 | | ||||
238 | void GCodeTests::command_M29() | ||||
239 | { | ||||
240 | QVERIFY(GCode::toCommand(GCode::M29) == QStringLiteral("ERROR! M29: It's obligatory to have an argument")); | ||||
241 | QVERIFY(GCode::toCommand(GCode::M29, QStringLiteral("FileName")) == QStringLiteral("M29 FileName")); | ||||
242 | } | ||||
243 | | ||||
244 | void GCodeTests::command_M30() | ||||
245 | { | ||||
246 | QVERIFY(GCode::toCommand(GCode::M30) == QStringLiteral("ERROR! M30: It's obligatory to have an argument")); | ||||
247 | QVERIFY(GCode::toCommand(GCode::M30, QStringLiteral("FileName")) == QStringLiteral("M30 FileName")); | ||||
248 | } | ||||
249 | | ||||
186 | void GCodeTests::command_M84() | 250 | void GCodeTests::command_M84() | ||
187 | { | 251 | { | ||
188 | QVERIFY(GCode::toCommand(GCode::M84) == QStringLiteral("M84")); | 252 | QVERIFY(GCode::toCommand(GCode::M84) == QStringLiteral("M84")); | ||
189 | QVERIFY(GCode::toCommand(GCode::M84, QStringLiteral("10")) == QStringLiteral("M84 S10")); | 253 | QVERIFY(GCode::toCommand(GCode::M84, QStringLiteral("10")) == QStringLiteral("M84 S10")); | ||
190 | } | 254 | } | ||
191 | 255 | | |||
192 | void GCodeTests::command_M104() | 256 | void GCodeTests::command_M104() | ||
193 | { | 257 | { | ||
▲ Show 20 Lines • Show All 1023 Lines • Show Last 20 Lines |