[gnome-keyring/trust-store] [testing] Make testing function names more palatable.



commit 46b6467072168226976c75da5ccf8c3a09e006f0
Author: Stef Walter <stefw collabora co uk>
Date:   Mon Nov 29 19:33:10 2010 +0000

    [testing] Make testing function names more palatable.

 testing/testing-build.sh |   14 +++++++-------
 testing/testing.h        |   12 ++++++------
 2 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/testing/testing-build.sh b/testing/testing-build.sh
index 5439a24..fe15122 100755
--- a/testing/testing-build.sh
+++ b/testing/testing-build.sh
@@ -24,7 +24,7 @@ file_to_name()
 
 testing_lines()
 {
-	grep -h "__testing_" $@ /dev/null || true
+	grep -h "testing__" $@ /dev/null || true
 }
 
 build_header()
@@ -57,14 +57,14 @@ build_source()
 	# Startup function
 	echo "static void start_tests (void) {"
 		echo $lines | sed -n \
-			-e "s/.*\(__testing_start_[0-9a-z_]\+\).*/	\1 ();/p"
+			-e "s/.*\(testing__start__[0-9a-z_]\+\).*/	\1 ();/p"
 	echo "}"
 	echo
 
 	# Shutdown function
 	echo "static void stop_tests (void) {"
 		echo $lines | sed -n \
-			-e "s/.*\(__testing_stop_[0-9a-z_]\+\).*/	\1 ();/p"
+			-e "s/.*\(testing__stop__[0-9a-z_]\+\).*/	\1 ();/p"
 	echo "}"
 	echo
 
@@ -82,9 +82,9 @@ build_source()
 		echo "	setup = teardown = NULL;"
 
 		testing_lines $file | sed -n \
-			-e "s/.*\(__testing_setup_[0-9a-z_]\+\).*/setup = \1;/p" \
-			-e "s/.*\(__testing_teardown_[0-9a-z_]\+\).*/teardown = \1;/p" \
-			-e "s/.*__testing_test_\([0-9a-z_]\+\).*/g_test_add(\"\/$name\/\1\", int, NULL, setup, __testing_test_\1, teardown);/p"
+			-e "s/.*\(testing__setup__[0-9a-z_]\+\).*/setup = \1;/p" \
+			-e "s/.*\(testing__teardown__[0-9a-z_]\+\).*/teardown = \1;/p" \
+			-e "s/.*testing__test__\([0-9a-z_]\+\).*/g_test_add(\"\/$name\/\1\", int, NULL, setup, testing__test__\1, teardown);/p"
 	done
 	echo "}"
 	echo
@@ -92,7 +92,7 @@ build_source()
 	# External function
 	echo "static void run_externals (int *ret) {"
 		echo $lines | sed -n \
-			-e "s/.*\(__testing_external_[0-9a-z_]\+\).*/	testing_external_run (\"\1\", \1, ret);/p"
+			-e "s/.*\(testing__external__[0-9a-z_]\+\).*/	testing_external_run (\"\1\", \1, ret);/p"
 	echo "}"
 	echo
 
diff --git a/testing/testing.h b/testing/testing.h
index 71a3d50..db217e4 100644
--- a/testing/testing.h
+++ b/testing/testing.h
@@ -84,17 +84,17 @@ const gchar*     testing_external_name            (void);
 void             testing_external_fail            (void);
 
 #define TESTING_SETUP(x) \
-	void __testing_setup_##x(int *__unused, gconstpointer __data)
+	void testing__setup__##x(int *__unused, gconstpointer __data)
 #define TESTING_TEARDOWN(x) \
-	void __testing_teardown_##x(int *__unused, gconstpointer __data)
+	void testing__teardown__##x(int *__unused, gconstpointer __data)
 #define TESTING_TEST(x) \
-	void __testing_test_##x(int *__unused, gconstpointer __data)
+	void testing__test__##x(int *__unused, gconstpointer __data)
 #define TESTING_START(x) \
-	void __testing_start_##x(void)
+	void testing__start__##x(void)
 #define TESTING_STOP(x) \
-	void __testing_stop_##x(void)
+	void testing__stop__##x(void)
 #define TESTING_EXTERNAL(x) \
-	void __testing_external_##x(void)
+	void testing__external__##x(void)
 
 #ifndef g_assert_cmpsize
 #define g_assert_cmpsize(a, o, b) \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]