You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include<catch.hpp>
#include"depthmapXcli/stepdepthparser.h"
#include"argumentholder.h"
#include"selfcleaningfile.h"
TEST_CASE("StepDepthParserFail", "Error cases")
{
SECTION("Missing argument to -sdp")
{
StepDepthParser parser;
ArgumentHolder ah{"prog", "-sdp"};
REQUIRE_THROWS_WITH(parser.parse(ah.argc(), ah.argv()), Catch::Contains("-sdp requires an argument"));
}
SECTION("Missing argument to -sdf")
{
StepDepthParser parser;
ArgumentHolder ah{"prog", "-sdf"};
REQUIRE_THROWS_WITH(parser.parse(ah.argc(), ah.argv()), Catch::Contains("-sdf requires an argument"));
}
SECTION("Missing argument to -sdt")
{
StepDepthParser parser;
ArgumentHolder ah{"prog", "-sdt"};
REQUIRE_THROWS_WITH(parser.parse(ah.argc(), ah.argv()), Catch::Contains("-sdt requires an argument"));
}
SECTION("rubbish input to -sdp")
{
StepDepthParser parser;
ArgumentHolder ah{"prog", "-sdp", "foo"};
REQUIRE_THROWS_WITH(parser.parse(ah.argc(), ah.argv()), Catch::Contains("Invalid step depth point provided (foo). Should only contain digits dots and commas"));