Skip to content

Commit 3ab55ec

Browse files
committed
Add goto_harness_generator.cpp
1 parent bd38fc4 commit 3ab55ec

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/******************************************************************\
2+
3+
Module: goto_harness_generator
4+
5+
Author: Diffblue Ltd.
6+
7+
\******************************************************************/
8+
9+
#include "goto_harness_generator.h"
10+
11+
#include <list>
12+
#include <string>
13+
14+
#include <util/exception_utils.h>
15+
#include <util/invariant.h>
16+
17+
std::string
18+
goto_harness_generatort::require_exactly_one_value(const std::string &option,
19+
const std::list<std::string> &values)
20+
{
21+
if(values.size() != 1)
22+
{
23+
throw invalid_command_line_argument_exceptiont{
24+
"expected exactly one value",
25+
"--" + option
26+
};
27+
}
28+
29+
return values.front();
30+
}
31+
32+
void goto_harness_generatort::assert_no_values(const std::string &option,
33+
const std::list<std::string> &values)
34+
{
35+
PRECONDITION_WITH_DIAGNOSTICS(values.empty(),
36+
option);
37+
}

0 commit comments

Comments
 (0)