1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#include <iostream>
#include "tclap/CmdLine.h"
using namespace TCLAP;
using namespace std;
int main()
{
try {
CmdLine cmd("test constraint bug");
ValueArg<int> arg("i","int", "tests int arg", false, 4711, NULL, cmd);
cout << "Expected exception" << endl;
} catch(std::logic_error &e) { /* expected */ }
try {
CmdLine cmd("test constraint bug");
ValueArg<int> arg1("i","int", "tests int arg", false, 4711, NULL, NULL);
cout << "Expected exception" << endl;
} catch(std::logic_error &e) { /* expected */ }
try {
CmdLine cmd("test constraint bug");
MultiArg<int> arg1("i","int", "tests int arg", false, NULL, NULL);
cout << "Expected exception" << endl;
} catch(std::logic_error &e) { /* expected */ }
try {
CmdLine cmd("test constraint bug");
MultiArg<int> arg1("i","int", "tests int arg", false, NULL, cmd);
cout << "Expected exception" << endl;
} catch(std::logic_error &e) { /* expected */ }
cout << "Passed" << endl;
}
|