From f1547632dc318b14d7edc66d0cc59ed778be237d Mon Sep 17 00:00:00 2001 From: Simon Butcher Date: Mon, 14 Mar 2016 23:09:39 +0000 Subject: [PATCH] Fixes to style following review Made code spacing consistent with guidelines, and corrected the misnamed test steps in basic-build-test.sh --- programs/test/selftest.c | 6 +++--- tests/scripts/basic-build-test.sh | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/programs/test/selftest.c b/programs/test/selftest.c index 5c4c737f3..b168b7112 100644 --- a/programs/test/selftest.c +++ b/programs/test/selftest.c @@ -99,7 +99,7 @@ static int run_test_snprintf( void ) int main( int argc, char *argv[] ) { - int ret = 0, v, suites_tested = 0, suites_failed =0, + int ret = 0, v, suites_tested = 0, suites_failed = 0, exitcode = EXIT_SUCCESS; #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) unsigned char buf[1000000]; @@ -376,7 +376,7 @@ int main( int argc, char *argv[] ) if( v != 0 ) { - mbedtls_printf( " Executed %d test suites\n\n", suites_tested); + mbedtls_printf( " Executed %d test suites\n\n", suites_tested ); if( suites_failed > 0) { @@ -395,6 +395,6 @@ int main( int argc, char *argv[] ) if( suites_failed > 0) exitcode = EXIT_FAILURE; - exit(exitcode); + exit( exitcode ); } diff --git a/tests/scripts/basic-build-test.sh b/tests/scripts/basic-build-test.sh index 25248d622..06c2eb9bd 100755 --- a/tests/scripts/basic-build-test.sh +++ b/tests/scripts/basic-build-test.sh @@ -94,7 +94,7 @@ TOTAL_AVAIL=$(($PASSED_TESTS + $FAILED_TESTS)) TOTAL_EXED=$(($PASSED_TESTS + $FAILED_TESTS)) -# Step 3b - Unit tests +# Step 4b - Unit tests echo "Unit tests - tests/scripts/run-test-suites.pl" PASSED_TESTS=$(tail -n6 unit-test-$TEST_OUTPUT|sed -n -e 's/test cases passed :[\t]*\([0-9]*\)/\1/p'| tr -d ' ') @@ -117,7 +117,7 @@ TOTAL_AVAIL=$(($TOTAL_AVAIL + $PASSED_TESTS + $FAILED_TESTS + $SKIPPED_TESTS)) TOTAL_EXED=$(($TOTAL_EXED + $PASSED_TESTS + $FAILED_TESTS)) -# Step 3c - TLS Options tests +# Step 4c - TLS Options tests echo "TLS Options tests - tests/ssl-opt.sh" PASSED_TESTS=$(tail -n5 sys-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p') @@ -139,7 +139,7 @@ TOTAL_AVAIL=$(($TOTAL_AVAIL + $TOTAL_TESTS + $SKIPPED_TESTS)) TOTAL_EXED=$(($TOTAL_EXED + $TOTAL_TESTS)) -# Step 3d - System Compatibility tests +# Step 4d - System Compatibility tests echo "System/Compatibility tests - tests/compat.sh" PASSED_TESTS=$(tail -n5 compat-test-$TEST_OUTPUT|sed -n -e 's/.* (\([0-9]*\) \/ [0-9]* tests ([0-9]* skipped))$/\1/p') @@ -161,7 +161,7 @@ TOTAL_AVAIL=$(($TOTAL_AVAIL + $EXED_TESTS + $SKIPPED_TESTS)) TOTAL_EXED=$(($TOTAL_EXED + $EXED_TESTS)) -# Step 3e - Grand totals +# Step 4e - Grand totals echo "-------------------------------------------------------------------------" echo "Total tests" @@ -173,7 +173,7 @@ echo "Total avail tests : $TOTAL_AVAIL" echo -# Step 3f - Coverage +# Step 4f - Coverage echo "Coverage" LINES_TESTED=$(tail -n3 cov-$TEST_OUTPUT|sed -n -e 's/ lines......: [0-9]*.[0-9]% (\([0-9]*\) of [0-9]* lines)/\1/p')