Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing "errors" reported by vera++ #89

Merged
merged 1 commit into from Dec 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ matrix:
script:
- mkdir build
- cd build
- if [ $USE_CMAKE == "YES" ] ; then cmake ../ ; fi
- if [ $USE_CMAKE == "NO" ] ; then pushd ../ ; autoreconf -i ; popd; fi
- if [ $USE_CMAKE == "NO" ] ; then ../configure ; fi
- if [ $USE_CMAKE == 'YES' ] ; then cmake .. ; fi
- if [ $USE_CMAKE == 'NO' ] ; then pushd .. ; autoreconf -i ; popd; fi
- if [ $USE_CMAKE == 'NO' ] ; then ../configure ; fi
- make
- if [ $USE_CMAKE == "YES" ] ; then CTEST_OUTPUT_ON_FAILURE=1 make test ; fi
- if [ $USE_CMAKE == "NO" ] ; then make check ; fi
- if [ $USE_CMAKE == 'YES' ] ; then CTEST_OUTPUT_ON_FAILURE=1 make test ; fi
- if [ $USE_CMAKE == 'NO' ] ; then make check ; fi
3 changes: 2 additions & 1 deletion src/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ void _tcase_add_test(TCase * tc, TFun fn, const char *name, int _signal,
tf->loop_start = start;
tf->loop_end = end;
tf->signal = _signal; /* 0 means no signal expected */
tf->allowed_exit_value = (WEXITSTATUS_MASK & allowed_exit_value); /* 0 is default successful exit */
tf->allowed_exit_value =
(WEXITSTATUS_MASK & allowed_exit_value); /* 0 is default successful exit */
tf->name = name;
check_list_add_end(tc->tflst, tf);
}
Expand Down
20 changes: 11 additions & 9 deletions src/check_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,12 @@ void xml_lfun(SRunner * sr CK_ATTRIBUTE_UNUSED, FILE * file,
switch (evt)
{
case CLINITLOG_SR:
fprintf(file, "<?xml version=\"1.0\"?>\n");
fprintf(file,
"<?xml-stylesheet type=\"text/xsl\" href=\"http://check.sourceforge.net/xml/check_unittest.xslt\"?>\n");
fprintf(file,
"<testsuites xmlns=\"http://check.sourceforge.net/ns\">\n");
fprintf(file, " <datetime>%s</datetime>\n", t);
"<?xml version=\"1.0\"?>\n"
"<?xml-stylesheet type=\"text/xsl\" "
"href=\"http://check.sourceforge.net/xml/check_unittest.xslt\"?>\n"
"<testsuites xmlns=\"http://check.sourceforge.net/ns\">\n"
" <datetime>%s</datetime>\n", t);
break;
case CLENDLOG_SR:
{
Expand All @@ -304,17 +304,19 @@ void xml_lfun(SRunner * sr CK_ATTRIBUTE_UNUSED, FILE * file,
/* calculate time the test were running */
clock_gettime(check_get_clockid(), &ts_end);
duration = (unsigned long)DIFF_IN_USEC(ts_start, ts_end);
fprintf(file, " <duration>%lu.%06lu</duration>\n",
fprintf(file,
" <duration>%lu.%06lu</duration>\n"
"</testsuites>\n",
duration / US_PER_SEC, duration % US_PER_SEC);
fprintf(file, "</testsuites>\n");
}
break;
case CLSTART_SR:
break;
case CLSTART_S:
s = (Suite *)obj;
fprintf(file, " <suite>\n");
fprintf(file, " <title>");
fprintf(file,
" <suite>\n"
" <title>");
fprint_xml_esc(file, s->name);
fprintf(file, "</title>\n");
break;
Expand Down
2 changes: 1 addition & 1 deletion src/check_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#ifndef HAVE_PTHREAD
#define pthread_mutex_lock(arg)
#define pthread_mutex_unlock(arg)
#define pthread_cleanup_push(f,a) {
#define pthread_cleanup_push(f, a) {
#define pthread_cleanup_pop(e) }
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/check_run.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static TestResult *tcase_run_tfun_fork(SRunner * sr, TCase * tc, TF * tfun,
alarm_received = 0;

if(timer_create(check_get_clockid(),
NULL /* fire SIGALRM if timer expires */ ,
NULL /* fire SIGALRM if timer expires */,
&timerid) == 0)
{
/* Set the timer to fire once */
Expand Down