Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This change allow to avoid the Visual C++ compiler Warning that occur when you try...
[simgrid.git] / src / xbt / cunit.c
index 0d1569c..a1718c9 100644 (file)
@@ -141,7 +141,7 @@ xbt_test_suite_t xbt_test_suite_new(const char *name, const char *fmt, ...) {
   va_list ap;
 
   if (!_xbt_test_suites) 
-    _xbt_test_suites = xbt_dynar_new(sizeof(xbt_test_suite_t),&xbt_test_suite_free);
+    _xbt_test_suites = xbt_dynar_new(sizeof(xbt_test_suite_t),xbt_test_suite_free);
 
   va_start(ap, fmt);
   vasprintf(&suite->title,fmt, ap);
@@ -245,7 +245,7 @@ static int xbt_test_suite_run(xbt_test_suite_t suite) {
     for (i=1;i<79;i++)
       suite_title[i]='=';
     suite_title[i++]='\n';
-    suite_title[i]='\0';
+    suite_title[79]='\0';
 
     sprintf(suite_title + 40 - (suite_len+4)/2, "[ %s ]", suite->title);
     suite_title[40 + (suite_len+5)/2] = '=';
@@ -461,6 +461,10 @@ static void apply_selection(char *selection) {
       enabling = 0;
       memmove(dir,dir+1,strlen(dir));
     }
+    if (dir[0] == '+') {
+      enabling = 1;
+      memmove(dir,dir+1,strlen(dir));
+    }
 
     p =strchr(dir,':');
     if (p) {
@@ -489,7 +493,7 @@ static void apply_selection(char *selection) {
       }
     } else {
       int it;
-      for (it=0; it<xbt_dynar_length(_xbt_test_suites); it++) {
+      for (it=0; it< (int)xbt_dynar_length(_xbt_test_suites); it++) {
        xbt_test_suite_t thissuite=xbt_dynar_get_as(_xbt_test_suites,it,xbt_test_suite_t);
        if (!strcmp(suitename,thissuite->name)) {
          /* Do not disable the whole suite when we just want to disable a child */
@@ -503,7 +507,7 @@ static void apply_selection(char *selection) {
          } else { /* act on one child only */
            int it2_unit;
            /* search it, first (we won't reuse it for external loop which gets broken) */
-           for (it2_unit=0; it2_unit<xbt_dynar_length(thissuite->units); it2_unit++) {
+           for (it2_unit=0; it2_unit< (int)xbt_dynar_length(thissuite->units); it2_unit++) {
              xbt_test_unit_t thisunit=xbt_dynar_get_as(thissuite->units,it2_unit,xbt_test_unit_t);
              if (!strcmp(thisunit->name,unitname)) {
                thisunit->enabled = enabling;