Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
706d3d9f
Commit
706d3d9f
authored
Jun 19, 2014
by
Michael Meyling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[trackrdrd] test: test_util prints more infos in error case, test_config.readAndFindError changed
parent
2f89215b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
test_config.c
trackrdrd/src/test/test_config.c
+10
-6
test_utils.c
trackrdrd/src/test/test_utils.c
+4
-2
No files found.
trackrdrd/src/test/test_config.c
View file @
706d3d9f
...
...
@@ -177,7 +177,7 @@ static const char
}
static
char
*
readAndFindError
(
const
char
*
confName
)
*
readAndFindError
(
const
char
*
confName
,
const
char
*
errmsg
)
{
int
err
;
...
...
@@ -185,10 +185,11 @@ static char
TEST_catchStderrStart
();
err
=
CONF_ReadFile
(
confName
,
CONF_Add
);
TEST_catchStderrEnd
();
VMASSERT
(
err
!=
0
,
"No error code during reading config
\"
%s
\"
: %i"
,
confName
,
err
);
err
=
TEST_stderrEquals
(
"Error in trackrdrd_010.conf line 16 (Invalid argument): "
\
"'unknown.module = /my/path/module.so'
\n
"
);
VMASSERT
(
err
==
0
,
"stderr output other than expected: %i"
,
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
);
return
NULL
;
}
...
...
@@ -197,7 +198,10 @@ static const char
*
test_CONF_ReadFile
(
void
)
{
printf
(
"... testing CONF_ReadFile
\n
"
);
returnIfNotNull
(
readAndFindError
(
"trackrdrd_010.conf"
));
returnIfNotNull
(
readAndFindError
(
"trackrdrd_010.conf"
,
\
"Error in trackrdrd_010.conf line 16 (Invalid argument): "
\
"'unknown.module = /my/path/module.so'
\n
"
));
return
NULL
;
}
...
...
trackrdrd/src/test/test_utils.c
View file @
706d3d9f
...
...
@@ -85,7 +85,8 @@ TEST_compareFiles(const char * fname1, const char * fname2)
fclose
(
fp1
);
fclose
(
fp2
);
if
(
ch1
!=
ch2
)
{
printf
(
" files differ at line: %i col: %i
\n
"
,
line
,
col
);
printf
(
" comparing files %s : %s, "
,
fname1
,
fname2
);
printf
(
"files differ at line: %i col: %i
\n
"
,
line
,
col
);
return
line
;
}
else
{
return
0
;
...
...
@@ -122,7 +123,8 @@ TEST_compareFileWithString(const char * fname, const char * text)
}
while
((
ch1
!=
EOF
)
&&
(
ch2
!=
'\0'
)
&&
(
ch1
==
ch2
));
fclose
(
fp1
);
if
(
ch1
!=
EOF
||
ch2
!=
'\0'
)
{
printf
(
" file differs at line: %i col: %i
\n
"
,
line
,
col
);
printf
(
" comparing file %s with text, "
,
fname
);
printf
(
"file differs at line: %i col: %i
\n
"
,
line
,
col
);
return
line
;
}
else
{
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment