Commit cb1c34cd authored by John DuBois's avatar John DuBois

[1324] Changes to allow for command line parser testing

Initial tests added
Some style cleanup
parent a3a4e317
......@@ -28,7 +28,8 @@ static void printHelp(const char *progName, const char *usage);
* 1 if argument processing was successful and the program should continue.
*/
int
procArgs(int argc, char **argv)
procArgs(int argc, const char *argv[], confdata_t *confdata,
const char **server)
{
char usage[] =
"Usage:\n\
......@@ -36,9 +37,12 @@ perfdhcp [-hv] [-4|-6] [-r<rate>] [-n<num-request>] [-p<test-period>]\n\
[-d<drop-time>] [-D<max-drop>] [-l<local-addr|interface>] [-i]\n\
[-x<diagnostic-selector>] [server]\n";
int v4 = 0;
int v6 = 0;
char *maxDropOpt;
const char *localName;
double dropTime;
double testPeriod;
const char *msg;
/* Names of configuration variables, for defaults file processor */
confvar_t optConf[] = {
......@@ -46,27 +50,29 @@ perfdhcp [-hv] [-4|-6] [-r<rate>] [-n<num-request>] [-p<test-period>]\n\
{ 'v', NULL, CF_SWITCH, NULL, 0 },
{ '4', NULL, CF_SWITCH, &v4, 1 },
{ '6', NULL, CF_SWITCH, &v6, 1 },
{ 'i', NULL, CF_SWITCH, &initialOnly, 1 },
{ 'i', NULL, CF_SWITCH, NULL, 1 },
{ 'l', NULL, CF_NE_STRING, &localName, 0 },
{ 'r', NULL, CF_POS_INT, &rate, 0 },
{ 'x', NULL, CF_STRING, &diagSelector, 0 },
{ 'r', NULL, CF_POS_INT, NULL, 0 },
{ 'x', NULL, CF_STRING, NULL, 0 },
{ 'd', NULL, CF_POS_FLOAT, &dropTime, 0 },
{ 'D', NULL, CF_STRING, &maxDropOpt, 0 },
{ 'n', NULL, CF_POS_INT, &numRequest, 0 },
{ 'n', NULL, CF_POS_INT, NULL, 0 },
{ 'p', NULL, CF_POS_FLOAT, &testPeriod, 0 },
{ '\0', NULL, CF_ENDLIST, NULL, 0 }
};
confdata_t confdata;
/* Process command line options and config file */
procOpts(&argc, &argv, optConf, &confdata, NULL, progName, usage);
msg = procOpts(&argc, &argv, optConf, confdata, NULL, progName, NULL);
if (msg != NULL) {
fprintf(stderr, "%s\n", msg);
return 2;
}
if (confdata.map['h']->num > 0) {
if (confdata->map['h']->num > 0) {
printHelp(progName, usage);
return 0;
}
if (confdata.map['v']->num > 0) {
if (confdata->map['v']->num > 0) {
printf("dhcpperf v1.0 2011-10-30\n");
return 0;
}
......@@ -78,17 +84,18 @@ perfdhcp [-hv] [-4|-6] [-r<rate>] [-n<num-request>] [-p<test-period>]\n\
switch (argc) {
case 0:
if (v6 && localName != NULL)
server = "all";
*server = "all";
else {
if (v6)
fprintf(stderr, "Use -l to specify an interface name.\n\%s\n", usage);
fprintf(stderr, "Use -l to specify an interface name.\n\%s\n",
usage);
else
fprintf(stderr, "Must specify a DHCP server.\n\%s\n", usage);
return 2;
}
break;
case 1:
server = argv[0];
*server = argv[0];
break;
default:
fprintf(stderr, "Too many arguments.\n\%s\n", usage);
......@@ -103,19 +110,20 @@ printHelp(const char *progName, const char *usage)
printf(
"%s: Execute a performance test against a DHCP server.\n\
%s\n\
The [server] argument is the name/address of the DHCP server to contact. For\n\
DHCPv4 operation, exchanges are initiated by transmitting a DHCP DISCOVER to\n\
this address. For DHCPv6 operation, exchanges are initiated by transmitting a\n\
DHCP SOLICIT to this address. In the DHCPv6 case, the special name \"all\" can\n\
be used to refer to All_DHCP_Relay_Agents_and_Servers (the multicast address\n\
FF02::1:2), or the special name \"servers\" to refer to All_DHCP_Servers (the\n\
multicast address FF05::1:3). The [server] argument is optional only in the\n\
case that -l is used to specify an interface, in which case [server] defaults\n\
The [server] argument is the name/address of the DHCP server to contact. \n\
For DHCPv4 operation, exchanges are initiated by transmitting a DHCP\n\
DISCOVER to this address. For DHCPv6 operation, exchanges are initiated\n\
by transmitting a DHCP SOLICIT to this address. In the DHCPv6 case, the\n\
special name \"all\" can be used to refer to\n\
All_DHCP_Relay_Agents_and_Servers (the multicast address FF02::1:2), or\n\
the special name \"servers\" to refer to All_DHCP_Servers (the multicast\n\
address FF05::1:3). The [server] argument is optional only in the case\n\
that -l is used to specify an interface, in which case [server] defaults\n\
to \"all\".\n\
\n\
Exchanges are initiated by transmitting a DHCP SOLICIT to\n\
All_DHCP_Relay_Agents_and_Servers (the multicast address FF02::1:2) via this\n\
interface.\n\
All_DHCP_Relay_Agents_and_Servers (the multicast address FF02::1:2) via\n\
this interface.\n\
\n\
The default is to perform a single 4-way exchange, effectively pinging the\n\
server. The -r option is used to set up a performance test.\n\
......@@ -124,16 +132,16 @@ Options:\n\
-4: DHCPv4 operation (default). This is incompatible with the -6 option.\n\
-6: DHCPv6 operation. This is incompatible with the -4 option.\n\
-h: Print this help.\n\
-i: Do only the initial part of an exchange: DO or SA, depending on whether -6\n\
is given.\n\
-i: Do only the initial part of an exchange: DO or SA, depending on\n\
whether -6 is given.\n\
-l<local-addr|interface>: For DHCPv4 operation, specify the local\n\
hostname/address to use when communicating with the server. By default,\n\
the interface address through which traffic would normally be routed to the\n\
server is used.\n\
For DHCPv6 operation, specify the name of the network interface via which\n\
exchanges are initiated. This must be specified unless a server name is\n\
given, in which case the interface through which traffic would normally be\n\
hostname/address to use when communicating with the server. By\n\
default, the interface address through which traffic would normally be\n\
routed to the server is used.\n\
For DHCPv6 operation, specify the name of the network interface via\n\
which exchanges are initiated. This must be specified unless a server\n\
name is given, in which case the interface through which traffic would\n\
normally be routed to the server is used.\n\
-r<rate>: Initiate <rate> DORA/SARR (or if -i is given, DO/SA) exchanges per\n\
second. A periodic report is generated showing the number of exchanges\n\
which were not completed, as well as the average response latency. The\n\
......@@ -148,55 +156,29 @@ Options:\n\
\n\
The remaining options are used only in conjunction with -r:\n\
\n\
-d<drop-time>: Specify the time after which a request is treated as having been\n\
lost. The value is given in seconds and may contain a fractional\n\
-d<drop-time>: Specify the time after which a request is treated as having\n\
been lost. The value is given in seconds and may contain a fractional\n\
component. The default is 1 second.\n\
-D<max-drop>: Abort the test if more than <max-drop> requests have been\n\
dropped. Use -D0 to abort if even a single request has been dropped. If\n\
<max-drop> includes the suffix \"%%\", it specifies a maximum percentage of\n\
requests that may be dropped before abort. In this case, testing of the\n\
threshold begins after 10 requests have been expected to be received.\n\
-n<num-request>: Initiate <num-request> transactions. No report is generated\n\
until all transactions have been initiated/waited-for, after which a report\n\
is generated and the program terminates.\n\
-p<test-period>: Send requests for the given test period, which is specified in\n\
the same manner as -d. This can be used as an alternative to -n, or both\n\
options can be given, in which case the testing is completed when either\n\
limit is reached.\n\
dropped. Use -D0 to abort if even a single request has been dropped. \n\
If <max-drop> includes the suffix \"%%\", it specifies a maximum\n\
percentage of requests that may be dropped before abort. In this\n\
case, testing of the threshold begins after 10 requests have been\n\
expected to be received.\n\
-n<num-request>: Initiate <num-request> transactions. No report is\n\
generated until all transactions have been initiated/waited-for, after\n\
which a report is generated and the program terminates.\n\
-p<test-period>: Send requests for the given test period, which is\n\
specified in the same manner as -d. This can be used as an\n\
alternative to -n, or both options can be given, in which case the\n\
testing is completed when either limit is reached.\n\
\n\
Exit status:\n\
The exit status is:\n\
0 on complete success.\n\
1 for a general error.\n\
2 if an error is found in the command line arguments.\n\
3 if there are no general failures in operation, but one or more exchanges are\n\
not successfully completed.\n",
3 if there are no general failures in operation, but one or more exchanges\n\
are not successfully completed.\n",
progName, usage);
}
// Null functions to get the tests compiling.
int parse(int, char**) {
// Argument names not given to prevent compiler warning about unused
// variables;
return (-1);
}
const char* getAddress() {
return (NULL);
}
uint16_t getPort() {
return (0);
}
uint32_t getTimeout() {
return (0);
}
const char* getQname() {
return (NULL);
}
/*
#ifdef __cplusplus
extern "C" {
#endif
*/
#include <stdint.h>
#include "procconf.h"
extern int v6;
extern int initialOnly;
extern const char *localName;
extern unsigned rate;
extern unsigned numRequest;
extern const char *server;
extern const char *diagSelector;
int procArgs(int argc, char **argv);
// Functions tested in cloptions unit test
int parse(int argc, char** argv);
const char* getAddress();
uint16_t getPort();
uint32_t getTimeout();
const char* getQname();
// Also need definitions of these values
namespace OptionInfo {
const uint32_t QR = 0x0001;
const uint32_t OP = 0x0002;
const uint32_t AA = 0x0004;
const uint32_t TC = 0x0008;
const uint32_t Z = 0x0010;
const uint32_t AD = 0x0020;
const uint32_t CD = 0x0040;
const uint32_t RC = 0x0080;
const uint32_t QC = 0x0100;
const uint32_t AC = 0x0200;
const uint32_t UC = 0x0400;
const uint32_t DC = 0x0800;
const uint32_t MS = 0x1000;
};
/*
#ifdef __cplusplus
}
#endif
*/
int procArgs(int argc, const char *argv[], confdata_t *confdata,
const char **server);
......@@ -54,3 +54,9 @@ vdkprintf(unsigned diag_req, const char format[], va_list ap)
if (diag_req & dk_diag_mask)
vfprintf(stderr, format, ap);
}
int
dk_set(unsigned diag_req)
{
return diag_req & dk_diag_mask;
}
......@@ -4,9 +4,6 @@ extern "C" {
#include <stdarg.h>
extern unsigned dk_diag_mask;
#define dk_set(diag_req) ((diag_req) & dk_diag_mask)
#define DK_ALL (~0)
struct dkdesc {
......@@ -17,6 +14,7 @@ struct dkdesc {
void dkprintf(unsigned diag_req, const char format[], ...);
void vdkprintf(unsigned diag_req, const char format[], va_list ap);
int dk_setup(const char *diag_str, const struct dkdesc *diags);
int dk_set(unsigned diag_req);
#ifdef __cplusplus
}
......
......@@ -67,13 +67,27 @@ static const struct dkdesc diagLetters[] = {
};
int
main(int argc, char *argv[])
main(int argc, const char *argv[])
{
int ret;
if ((ret = procArgs(argc, argv)) != 1)
int v6;
// int initialOnly;
const char *localName = NULL;
// unsigned rate;
// unsigned numRequest;
const char *server;
const char *diagSelector = "";
confdata_t confdata;
if ((ret = procArgs(argc, argv, &confdata, &server)) != 1)
exit(ret);
v6 = confdata.map['6']->num > 0;
if (confdata.map['l']->num > 0)
localName = confdata.map['l']->values[0]->value.string;
if (confdata.map['x']->num > 0)
diagSelector = confdata.map['x']->values[0]->value.string;
srand(time(NULL));
if (v6)
sarr(server, localName);
......
......@@ -60,15 +60,18 @@ pc_malloc(size_t size)
}
static void
opterror(const char *expected, const char *value, const confvar_t *varDesc, const char filename[], const char *detail)
opterror(const char *expected, const char *value, const confvar_t *varDesc,
const char filename[], const char *detail)
{
if (detail == NULL)
detail = "";
if (filename == NULL)
error(USAGE_ERROR, "Invalid value given for option -%c: expected %s, got: %s%s",
error(USAGE_ERROR,
"Invalid value given for option -%c: expected %s, got: %s%s",
varDesc->outind, expected, value, detail);
else
error(USAGE_ERROR, "Invalid value given in configuration file \"%s\" for option %s: expected %s, got: %s%s",
error(USAGE_ERROR, "Invalid value given in configuration file \"%s\""
" for option %s: expected %s, got: %s%s",
filename, varDesc->varname, expected, value, detail);
}
......@@ -136,7 +139,8 @@ addOptVal(const cf_source source, const char *value, const confvar_t *varDesc,
errno = 0;
data.value.intval = strtol(value, &ptr, 0);
if (errno == ERANGE) {
opterror("an integer", value, varDesc, filename, " (out of range)");
opterror("an integer", value, varDesc, filename,
" (out of range)");
return -1;
}
err = *value == '\0' || *ptr != '\0';
......@@ -149,7 +153,8 @@ addOptVal(const cf_source source, const char *value, const confvar_t *varDesc,
break;
case CF_NON_NEG_INT:
if (err || data.value.intval < 0) {
opterror("a non-negative integer", value, varDesc, filename, NULL);
opterror("a non-negative integer", value, varDesc, filename,
NULL);
return -1;
}
data.value.nnint = data.value.intval;
......@@ -191,7 +196,8 @@ addOptVal(const cf_source source, const char *value, const confvar_t *varDesc,
break;
case CF_NON_NEG_FLOAT:
if (err || data.value.floatval < 0) {
opterror("a non-negative number", value, varDesc, filename, NULL);
opterror("a non-negative number", value, varDesc, filename,
NULL);
return -1;
}
break;
......@@ -211,7 +217,8 @@ addOptVal(const cf_source source, const char *value, const confvar_t *varDesc,
case CF_SWITCH:
case CF_NOCONF:
case CF_SDEBUG:
if (source == CF_FILE && *value != '1') /* option not turned on; ignore */
/* If option not turned on, ignore */
if (source == CF_FILE && *value != '1')
return 0;
data.value.switchval = varDesc->value;
value = "1"; /* for debugging */
......@@ -247,15 +254,18 @@ addOptVal(const cf_source source, const char *value, const confvar_t *varDesc,
*last = ret_data;
if (debugLevel >= VERBOSE_DEBUG)
fprintf(stderr, "Option %c (%s) gets value \"%s\" from %s%s\n",
0 < varDesc->outind && varDesc->outind < 256 ? varDesc->outind : '-',
0 < varDesc->outind && varDesc->outind < 256 ?
varDesc->outind : '-',
varDesc->varname == NULL ? "-" : varDesc->varname, value,
source == CF_ARGS ? "command line" : "config file", seen ? " (already seen)" : "");
source == CF_ARGS ? "command line" : "config file", seen ?
" (already seen)" : "");
return 1;
}
/*
* This currently depends on defread(). A CDDL version of the def* library exists:
* http://www.opensource.apple.com/source/autofs/autofs-207/automountlib/deflt.c
* This currently depends on defread().
* A CDDL version of the def* library exists:
*http://www.opensource.apple.com/source/autofs/autofs-207/automountlib/deflt.c
* But, this should really be rewritten to not use defread().
*/
#ifdef DEFREAD
......@@ -276,8 +286,8 @@ addOptVal(const cf_source source, const char *value, const confvar_t *varDesc,
* -1 is returned.
*/
static int
procConfFile(const char filename[], const confvar_t optConf[], confval *first[], confval *last[])
{
procConfFile(const char filename[], const confvar_t optConf[],
confval *first[], confval *last[]) {
int count;
char *home;
int ind;
......@@ -321,7 +331,8 @@ procConfFile(const char filename[], const confvar_t optConf[], confval *first[],
error(INTERNAL_ERROR, "Out of memory");
return -1;
}
switch ((ret = addOptVal(CF_FILE, s, &optConf[ind], &first[ind], &last[ind], filename))) {
switch ((ret = addOptVal(CF_FILE, s, &optConf[ind], &first[ind],
&last[ind], filename))) {
case 1:
count++;
break;
......@@ -352,7 +363,8 @@ procConfFile(const char filename[], const confvar_t optConf[], confval *first[],
* -1 is returned.
*/
static int
procCmdLineArgs(int *argc, char **argv[], const confvar_t optConf[], confval **first, confval **last)
procCmdLineArgs(int *argc, const char **argv[], const confvar_t optConf[],
confval **first, confval **last)
{
char *p;
extern char *optarg; /* For getopt */
......@@ -364,6 +376,7 @@ procCmdLineArgs(int *argc, char **argv[], const confvar_t optConf[], confval **f
unsigned confNum;
int count = 0;
optind = 1;
p = optstr;
*(p++) = ':';
for (confNum = 0; optConf[confNum].type != CF_ENDLIST; confNum++) {
......@@ -383,7 +396,7 @@ procCmdLineArgs(int *argc, char **argv[], const confvar_t optConf[], confval **f
}
}
*p = '\0';
while ((optchar = getopt(*argc, *argv, optstr)) != -1) {
while ((optchar = getopt(*argc, const_cast<char **>(*argv), optstr)) != -1) {
int ind;
int ret;
......@@ -396,7 +409,8 @@ procCmdLineArgs(int *argc, char **argv[], const confvar_t optConf[], confval **f
return -1;
}
ind = optCharToConf[optchar];
switch (ret = addOptVal(CF_ARGS, optarg, &optConf[ind], &first[ind], &last[ind], NULL)) {
switch (ret = addOptVal(CF_ARGS, optarg, &optConf[ind], &first[ind],
&last[ind], NULL)) {
case 1:
count++;
break;
......@@ -411,14 +425,42 @@ procCmdLineArgs(int *argc, char **argv[], const confvar_t optConf[], confval **f
return count;
}
/*
* Input variables:
* argc, argv: Command line data.
* optConf[]: Option description structures.
* confFile[]: Configuration file, or NULL if none provided.
* name: Name of program, for messages.
* usage: Usage message. If non-null, on error a message is printed to stderr
* and the program exits.
*
* Output variables:
* The processed option values are stored in confdata.
* A pointer to the start of the values for each option is stored in
* confdata->optVals[].values at the same offset as the option appears in
* confdata[].
* For any option for option characters/indexes have been used,
* confdata->map[index] is set to the same data.
* After processing, argc will have been adjusted to be the number of
* non-option arguments and argv will have been adjusted to start with the
* first non-option argument.
*
* Return value:
* On success, NULL.
* On error, a message describing the problem.
*/
const char *
procOpts(int *argc, char **argv[], const confvar_t optConf[], confdata_t *confdata,
const char confFile[], const char name[], const char usage[])
procOpts(int *argc, const char **argv[], const confvar_t optConf[],
confdata_t *confdata, const char confFile[], const char name[],
const char usage[])
{
/* Number of configuration options given in optConf */
unsigned numConf;
confval **first, **last; /* first & last records in the linked list maintained for each option */
unsigned maxOptIndex = 0;
int count; /* number of option instances found */
/* First & last records in the linked list maintained for each option */
confval **first, **last;
unsigned maxOptIndex = 0; /* The highest option index number seen */
/* number of option instances + assignments given */
int numOptsFound;
unsigned optNum;
unsigned i;
confval **valuePointers;
......@@ -432,12 +474,14 @@ procOpts(int *argc, char **argv[], const confvar_t optConf[], confdata_t *confda
maxOptIndex = outind & ~CF_NOTFLAG;
}
if ((first = (confval **)pc_malloc(sizeof(confval *) * numConf)) == NULL ||
(last = (confval **)pc_malloc(sizeof(confval *) * numConf)) == NULL)
(last =
(confval **)pc_malloc(sizeof(confval *) * numConf)) == NULL)
return errmsg;
memset(first, '\0', sizeof(confval *) * numConf);
memset(last, '\0', sizeof(confval *) * numConf);
if ((count = procCmdLineArgs(argc, argv, optConf, first, last)) < 0)
if ((numOptsFound =
procCmdLineArgs(argc, argv, optConf, first, last)) < 0)
return errmsg;
if (readConf && confFile != NULL) {
#ifdef DEFREAD
......@@ -446,7 +490,7 @@ procOpts(int *argc, char **argv[], const confvar_t optConf[], confdata_t *confda
if ((ret = procConfFile(confFile, optConf, first, last)) < 0)
return errmsg;
else
count += ret;
nummOptsFound += ret;
#else
error(INTERNAL_ERROR, "Built without defread!");
return errmsg;
......@@ -459,18 +503,24 @@ procOpts(int *argc, char **argv[], const confvar_t optConf[], confdata_t *confda
* All options have been read & initial processing done.
* An array of pointers is now generated for the options.
*/
if ((valuePointers = (confval **)pc_malloc(sizeof(confval *) * count)) == NULL ||
(confdata->optVals = (cf_option *)pc_malloc(sizeof(cf_option) * numConf)) == NULL)
if ((valuePointers =
(confval **)pc_malloc(sizeof(confval *) * numOptsFound)) == NULL ||
(confdata->optVals =
(cf_option *)pc_malloc(sizeof(cf_option) * numConf)) == NULL)
return errmsg;
/* If option index numbers are used, allocate a map for them */
if (maxOptIndex != 0) {
if ((confdata->map = (cf_option **)pc_malloc(sizeof(cf_option) * (maxOptIndex+1))) == NULL)
if ((confdata->map =
(cf_option **)pc_malloc(sizeof(cf_option) * (maxOptIndex+1)))
== NULL)
return errmsg;
memset(confdata->map, '\0', sizeof(confval *) * (maxOptIndex+1));
}
/*
* Store the linked lists of option values into arrays.
* Pointers to all option instances are stored in valuePointers.
* Pointers to all option instances are stored in valuePointers,
* with the values for each particular option being contiguous.
*/
i = 0;
for (optNum = 0; optNum < numConf; optNum++) {
......@@ -488,7 +538,8 @@ procOpts(int *argc, char **argv[], const confvar_t optConf[], confdata_t *confda
if (debugLevel > 5)
fprintf(stderr, "Option %c (%s) got %d values\n",
outind == 0 ? '-' : outind,
optConf[optNum].varname == NULL ? "-" : optConf[optNum].varname,
optConf[optNum].varname == NULL ? "-" :
optConf[optNum].varname,
confdata->optVals[optNum].num);
}
free(first);
......
#ifdef __cplusplus
extern "C" {
#endif
#ifndef PROCCONF_H
#define PROCCONF_H
#include <limits.h> /* for UINT_MAX */
......@@ -25,6 +24,11 @@ typedef enum {
CF_NONE, CF_ARGS, CF_FILE
} cf_source;
/*
* This is to be OR'd into a confvar_t outind to indicate that an index
* number that is given is not to be interpreted as a command line option
* character.
*/
#define CF_NOTFLAG (UINT_MAX & ~(UINT_MAX >> 1))
/*
......@@ -35,7 +39,7 @@ typedef enum {
*/
typedef struct {
unsigned outind; /* Single-character option, or option output index */
char *varname; /* Long name, for config file and eventually long option */
char *varname; /* Long name, for config file and long option */
cf_type type; /* Option type */
const void *addr; /* Address of variable associated with this option */
int value; /* Value to assign to switch options */
......@@ -68,13 +72,12 @@ typedef struct {
typedef struct {
cf_option *optVals; /* All option values */
cf_option **map; /* Option values indexed by option-char / option-index */
cf_option **map; /* Option values indexed by option-char/option-index */
} confdata_t;
const char *
procOpts(int *argc, char **argv[], const confvar_t optConf[], confdata_t *confdata, const char confFile[], const char name[],
procOpts(int *argc, const char **argv[], const confvar_t optConf[],
confdata_t *confdata, const char confFile[], const char name[],
const char usage[]);
#ifdef __cplusplus
}
#endif
......@@ -16,7 +16,7 @@ TESTS += run_unittests
run_unittests_SOURCES = run_unittests.cc
run_unittests_SOURCES += cloptions_unittest.cc
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/cloptions.cc
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/externals.cc
run_unittests_SOURCES += $(top_builddir)/tests/tools/perfdhcp/procconf.cc
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
......
......@@ -19,275 +19,293 @@
#include "../cloptions.h"
/// \brief Check Non-Limit Options
///
/// Checks that the options that are NOT related to the message are set to
/// their default values.
void checkDefaultOtherValues() {
EXPECT_STREQ("127.0.0.1", getAddress());
EXPECT_EQ(53, getPort());
EXPECT_EQ(500, getTimeout());