File: test28.cpp

package info (click to toggle)
tclap 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, experimental, forky, sid, trixie
  • size: 10,584 kB
  • sloc: cpp: 3,724; xml: 1,028; sh: 855; makefile: 308; javascript: 214; ansic: 43
file content (35 lines) | stat: -rw-r--r-- 976 bytes parent folder | download | duplicates (2)
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;
}