MCPcopy Create free account
hub / github.com/KDE/labplot / testequalEpsilon

Method testequalEpsilon

tests/backend/gsl/ExpressionParserTest.cpp:251–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249 QCOMPARE(fnct(5.11, 1, 5), 1);
250}
251void ExpressionParserTest::testequalEpsilon() {
252 auto fnct = getFunction3(QStringLiteral("equalE"));
253 QVERIFY(fnct);
254
255 QCOMPARE(fnct(0.99, 1, 5), 1);
256 QCOMPARE(fnct(1, 1, 5), 1);
257 QCOMPARE(fnct(2, 1, 5), 1);
258 QCOMPARE(fnct(5, 1, 5), 1);
259 QCOMPARE(fnct(5.11, 1, 5), 1);
260
261 QCOMPARE(fnct(5.11, 5.3, 0.1), 0);
262 QCOMPARE(fnct(-5.11, 5.3, 0.2), 0);
263 QCOMPARE(fnct(-5.11, -5.3, 0.2), 1);
264}
265
266void ExpressionParserTest::testRoundn() {
267 auto fnct = getFunction2(QStringLiteral("roundn"));

Callers

nothing calls this directly

Calls 1

getFunction3Function · 0.85

Tested by

no test coverage detected