summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2003-11-22 04:08:11 +0000
committerDavid Schleef <ds@schleef.org>2003-11-22 04:08:11 +0000
commit04d02e08b6f464a6d6aeed57e2626e5a2784ca99 (patch)
tree8426ffe916da846620e20824f2347e575101cb07 /tests
parent3863b258b2cf4814ce4cd8b6bc1656ea0a649104 (diff)
check g_signal_new() calls
Original commit message from CVS: check g_signal_new() calls
Diffstat (limited to 'tests')
-rwxr-xr-xtests/old/testsuite/gst-lint22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/old/testsuite/gst-lint b/tests/old/testsuite/gst-lint
index 3a5d46817..97575fef1 100755
--- a/tests/old/testsuite/gst-lint
+++ b/tests/old/testsuite/gst-lint
@@ -38,6 +38,7 @@ sub check_debugging();
sub check_old_typefind();
sub check_bad_casts();
sub check_old_plugin();
+sub check_signal_new();
sub m_check_plugindir();
@@ -69,6 +70,7 @@ foreach $filename (<FIND>) {
check_old_typefind();
check_bad_casts();
check_old_plugin();
+ check_signal_new();
}
open FIND, "find . -name \"Makefile.am\" -print|";
@@ -377,3 +379,23 @@ sub check_old_plugin()
}
}
+#
+# Check for calls to g_signal_new() with a callback type of G_TYPE_POINTER
+#
+sub check_signal_new()
+{
+ my $n = 0;
+ my $lineno = 1;
+
+ foreach $line (@lines){
+ if($line =~ /g_signal_new/){
+ $n=5;
+ }
+ if($n>0 && $line =~ /G_TYPE_POINTER/){
+ print "W: ($lineno) g_signal_new() with callback type of G_TYPE_POINTER. Register and use a boxed type instead.\n";
+ return;
+ }
+ $n--;
+ $lineno++;
+ }
+}