Commit 59734e30 authored by Geoff Simmons's avatar Geoff Simmons

style fascism:

* source file line width always <= 80 chars
* continuation lines only where necessary
parent 76cb8540
......@@ -147,7 +147,8 @@ static char
err = CONF_ReadDefault();
VMASSERT(err == 0, "Error code during reading default config: %i", err);
err = CONF_ReadFile(confName, CONF_Add);
VMASSERT(err == 0, "Error code during reading config \"%s\": %i", confName, err);
VMASSERT(err == 0,
"Error code during reading config \"%s\": %i", confName, err);
// verbose("Config is:\n%s", getConfigContent());
strcpy(confNameNew, confName);
......@@ -185,11 +186,13 @@ static char
TEST_catchStderrStart();
err = CONF_ReadFile(confName, CONF_Add);
TEST_catchStderrEnd();
VMASSERT(err == -1, "Wrong error code during reading config \"%s\": %i", confName, err);
VMASSERT(err == -1, "Wrong error code during reading config \"%s\": %i",
confName, err);
err = TEST_stderrEquals(errmsg);
VMASSERT(err == 0, "stderr output during parsing config \"%s\" other than expected. " \
"Expected:\n%s",
confName, errmsg);
VMASSERT(err == 0,
"stderr output during parsing config \"%s\" other than expected. "
"Expected:\n%s",
confName, errmsg);
return NULL;
}
......@@ -199,9 +202,11 @@ static const char
{
printf("... testing CONF_ReadFile\n");
returnIfNotNull(readAndFindError("trackrdrd_010.conf", \
"Error in trackrdrd_010.conf line 16 (Invalid argument): " \
"'unknown.module = /my/path/module.so'\n"));
returnIfNotNull(
readAndFindError("trackrdrd_010.conf",
"Error in trackrdrd_010.conf line 16 "
"(Invalid argument): "
"'unknown.module = /my/path/module.so'\n"));
return NULL;
}
......
......@@ -141,8 +141,9 @@ TEST_catchStdoutStart()
fflush(stdout);
fgetpos(stdout, &stdoutPos);
stdoutBak = dup(fileno(stdout));
stdoutNew = open(FILE_NAME_STDOUT, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \
S_IROTH | S_IWOTH);
stdoutNew = open(FILE_NAME_STDOUT,
O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP
| S_IROTH | S_IWOTH);
dup2(stdoutNew, fileno(stdout));
close(stdoutNew);
......@@ -170,8 +171,9 @@ TEST_catchStderrStart()
fgetpos(stdout, &stderrPos);
stderrBak = dup(fileno(stderr));
stderrNew = open(FILE_NAME_STDERR, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \
S_IROTH | S_IWOTH);
stderrNew = open(FILE_NAME_STDERR,
O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP
| S_IROTH | S_IWOTH);
if (stderrNew < 0) {
perror(NULL);
return(-1);
......
......@@ -49,14 +49,17 @@
#define VERBOSE 1
#undef VERBOSE
#ifdef VERBOSE
#define verbose(fmt, ...) \
do { printf("%8s:%4d:%20s:>>> "fmt"\n", __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } \
#define verbose(fmt, ...) \
do { \
printf("%8s:%4d:%20s:>>> "fmt"\n", __FILE__, __LINE__, __FUNCTION__, \
##__VA_ARGS__); } \
while (0)
#else
#define verbose(fmt, ...) do{ } while ( 0 )
#endif
#define returnIfNotNull(test) do { const char *msg = test; if (msg) return msg; } while (0)
#define returnIfNotNull(test) \
do { const char *msg = test; if (msg) return msg; } while (0)
/***** constants **************************************************************/
......@@ -99,8 +102,8 @@ extern int TEST_catchStderrStart(void);
extern int TEST_catchStderrEnd(void);
/**
* Test if files have same content. If the comparison is not successful some info
* is written to stderr.
* Test if files have same content. If the comparison is not successful
* some info is written to stderr.
*
* @param fname1 first file.
* @param fname2 second file.
......@@ -120,22 +123,24 @@ extern int TEST_compareFiles(const char * fname1, const char * fname2);
extern int TEST_compareFileWithString(const char * fname, const char * text);
/**
* Test if previously saved stdout equals given text. See TEST_catchStdoutStart() and
* TEST_catchStdoutEnd().
* Test if previously saved stdout equals given text. See
* TEST_catchStdoutStart() and TEST_catchStdoutEnd().
*
* @param text compare stdout with this text.
* @return 0 on success, a value < 0 if we had problems reading the stdout file and a
* line number (starting with 1) if there was a difference in that line.
* @return 0 on success, a value < 0 if we had problems reading the stdout
* file and a line number (starting with 1) if there was a difference
* in that line.
*/
extern int TEST_stdoutEquals(const char * text);
/**
* Test if previously saved stderr equals given text. See TEST_catchStderrStart() and
* TEST_catchStderrEnd().
* Test if previously saved stderr equals given text. See
* TEST_catchStderrStart() and TEST_catchStderrEnd().
*
* @param text compare stderr with this text.
* @return 0 on success, a value < 0 if we had problems reading the stderr file and a
* line number (starting with 1) if there was a difference in that line.
* @return 0 on success, a value < 0 if we had problems reading the stderr
* file and a line number (starting with 1) if there was a difference
* in that line.
*/
extern int TEST_stderrEquals(const char * text);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment