diff --git a/.travis.yml b/.travis.yml index 650bf31f..2bb83b5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ # Copyright (C) 2016 Branden Archer # Copyright (C) 2016 Joshua D. Boyd +# Copyright (C) 2016 Nicola Spanti # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -35,6 +36,7 @@ addons: apt: packages: - texinfo + - cppcheck matrix: exclude: @@ -45,11 +47,12 @@ matrix: env: USE_CMAKE=YES script: + - if [ ${TRAVIS_OS_NAME} = 'linux' ]; then cppcheck --verbose --quiet --error-exitcode=1 --force --enable=performance,portability src/ tests/; fi - 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 diff --git a/src/check_str.c b/src/check_str.c index 58fdc11d..3290822e 100644 --- a/src/check_str.c +++ b/src/check_str.c @@ -127,9 +127,8 @@ static int percent_passed(TestStats * t) { if(t->n_failed == 0 && t->n_errors == 0) return 100; - else if(t->n_checked == 0) + if(t->n_checked == 0) return 0; - else - return (int)((float)(t->n_checked - (t->n_failed + t->n_errors)) / - (float)t->n_checked * 100); + return (int)((float)(t->n_checked - (t->n_failed + t->n_errors)) / + (float)t->n_checked * 100); }