From de56ca109799673b0c88c5127ca05186d3331db0 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Sun, 15 Sep 2013 17:05:21 +0200
Subject: [PATCH] The suite specific header should only be used when the suite
is active
---
tests/scripts/generate_code.pl | 2 ++
tests/suites/main_test.function | 11 ++++++-----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/tests/scripts/generate_code.pl b/tests/scripts/generate_code.pl
index 40f993ff8..1e33ac612 100755
--- a/tests/scripts/generate_code.pl
+++ b/tests/scripts/generate_code.pl
@@ -61,7 +61,9 @@ open(TEST_FILE, ">$test_file") or die "Opening destination file '$test_file': $!
print TEST_FILE << "END";
#include
+$suite_pre_code
$suite_header
+$suite_post_code
$test_helpers
diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function
index 4a343190b..d5aa3862c 100644
--- a/tests/suites/main_test.function
+++ b/tests/suites/main_test.function
@@ -3,6 +3,9 @@
static int test_errors = 0;
+SUITE_PRE_DEP
+#define TEST_SUITE_ACTIVE
+
static int test_assert( int correct, char *test )
{
if( correct )
@@ -81,6 +84,9 @@ MAPPING_CODE
return( -1 );
}
+FUNCTION_CODE
+SUITE_POST_DEP
+
int dep_check( char *str )
{
if( str == NULL )
@@ -91,11 +97,6 @@ DEP_CHECK_CODE
return( 1 );
}
-SUITE_PRE_DEP
-#define TEST_SUITE_ACTIVE
-FUNCTION_CODE
-SUITE_POST_DEP
-
int dispatch_test(int cnt, char *params[50])
{
int ret;