MCPcopy Create free account
hub / github.com/cutelyst/cutelyst / testValidatorBoolean_data

Method testValidatorBoolean_data

tests/testvalidator.cpp:1651–1670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1649}
1650
1651void TestValidator::testValidatorBoolean_data()
1652{
1653 QTest::addColumn<QString>("url");
1654 QTest::addColumn<QByteArray>("body");
1655 QTest::addColumn<QByteArray>("output");
1656
1657 // **** Start testing ValidatorBoolean *****
1658
1659 for (const QString &bv : {u"1"_s, u"0"_s, u"true"_s, u"false"_s, u"on"_s, u"off"_s}) {
1660 QTest::newRow(u"valid-%1"_s.arg(bv).toUtf8().constData())
1661 << u"/boolean?boolean_field="_s + bv << QByteArray() << valid;
1662 }
1663
1664 for (const QString &bv : {u"2"_s, u"-45"_s, u"wahr"_s, u"unwahr"_s, u"ja"_s}) {
1665 QTest::newRow(u"invalid-%1"_s.arg(bv).toUtf8().constData())
1666 << u"/boolean?boolean_field="_s + bv << QByteArray() << invalid;
1667 }
1668
1669 QTest::newRow("empty") << u"/boolean?boolean_field="_s << QByteArray() << valid;
1670}
1671
1672void TestValidator::testValidatorCharNotAllowed_data()
1673{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected