Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
be a bit more paranoid: if a line looks like something we should have understood...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Jul 2009 15:28:52 +0000 (15:28 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Jul 2009 15:28:52 +0000 (15:28 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6485 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/dynar.c
src/xbt/xbt_str.c
src/xbt/xbt_strbuff.c
tools/sg_unit_extractor.pl

index 68be697..b6af152 100644 (file)
@@ -1196,8 +1196,7 @@ static void poper_f(void *a)
 }
 
 
-XBT_TEST_UNIT("synchronized int", test_dynar_sync_int,
-              "Synchronized dynars of integers")
+XBT_TEST_UNIT("synchronized int", test_dynar_sync_int,"Synchronized dynars of integers")
 {
   /* Vars_decl [doxygen cruft] */
   xbt_dynar_t d;
index e43bdc9..a3add85 100644 (file)
@@ -434,8 +434,7 @@ xbt_dynar_t xbt_str_split_quoted(const char *s)
                    xbt_dynar_free(&d);
 
 XBT_TEST_SUITE("xbt_str", "String Handling");
-XBT_TEST_UNIT("xbt_str_split_quoted", test_split_quoted,
-              "test the function xbt_str_split_quoted")
+XBT_TEST_UNIT("xbt_str_split_quoted", test_split_quoted,"test the function xbt_str_split_quoted")
 {
   xbt_dynar_t d;
   char *s;
@@ -467,8 +466,7 @@ XBT_TEST_UNIT("xbt_str_split_quoted", test_split_quoted,
                    free(s); \
                    xbt_dynar_free(&d);
 
-XBT_TEST_UNIT("xbt_str_split_str", test_split_str,
-              "test the function xbt_str_split_str")
+XBT_TEST_UNIT("xbt_str_split_str", test_split_str,"test the function xbt_str_split_str")
 {
   xbt_dynar_t d;
   char *s;
index f734c48..c6cc67a 100644 (file)
@@ -321,8 +321,7 @@ static void mytest(const char *input, const char *patterns,
 }
 
 XBT_TEST_SUITE("xbt_strbuff", "String Buffers");
-XBT_TEST_UNIT("xbt_strbuff_substitute", test_strbuff_substitute,
-              "test the function xbt_strbuff_substitute")
+XBT_TEST_UNIT("xbt_strbuff_substitute", test_strbuff_substitute,"test the function xbt_strbuff_substitute")
 {
   xbt_test_add0("Empty");
   mytest("", "", "");
index 37b7025..24a1168 100755 (executable)
@@ -48,18 +48,24 @@ sub process_one($) {
            next
        }
        
-       if (m/XBT_TEST_SUITE\(\w*"([^"]*)"\w*,(.*?)\);/) { #" {
+       if (m/XBT_TEST_SUITE\(\w*"([^"]*)"\w*, *(.*?)\);/) { #" {
            die "$progname: Multiple suites in the same file ($infile) are not supported yet\n" if length($suite_name);
            ($suite_name,$suite_title)=($1,$2);
+           die "$progname: Empty suite name in $infile" unless length($suite_name);
+           die "$progname: Empty suite title in $infile" unless length($suite_title);
            next;
-        } 
+        } elsif (m/XBT_TEST_SUITE/) {
+           die "$progname: Parse error: This line seem to be a test suite declaration, but failed to parse it\n$_\n";
+       }
 
         if (m/XBT_TEST_UNIT\(\w*"([^"]*)"\w*,([^,]*),(.*?)\)/) { #"{
            die "$progname: multiply defined unit in file $infile: $1\n" if (defined($tests{$1}));
-      
+            
            my @t=($1,$2,$3);
            push @tests,\@t;
            $tests{$1} = 1;
+       } elsif (m/XBT_TEST_UNIT/) {
+           die "$progname: Parse error: This line seem to be a test unit, but failed to parse it\n$_\n";
        }
         $unit_source .= $_ if $takeit;
     }