Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Declare LOG_DEFAULT_CATEGORY with LOG_NEW_DEFAULT_SUBCATEGORY.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 18 Jun 2010 10:07:28 +0000 (10:07 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 18 Jun 2010 10:07:28 +0000 (10:07 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7900 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/config_unit.c
src/dict_unit.c
src/dynar_unit.c
src/xbt/config.c
src/xbt/dict.c
src/xbt/dynar.c

index 5d10c3c..aee0d73 100644 (file)
@@ -12,7 +12,7 @@
 #include "xbt.h"
 #include "xbt/ex.h"
 
-XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg);
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support");
 
 
 static xbt_cfg_t make_set()
index 55ac0e8..56e96f2 100644 (file)
@@ -14,7 +14,8 @@
 #include "portable.h"
 
 XBT_LOG_EXTERNAL_CATEGORY(xbt_dict);
-XBT_LOG_DEFAULT_CATEGORY(xbt_dict);
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict, xbt,
+                                "Dictionaries provide the same functionalities than hash tables");
 
 
 static void print_str(void *str)
@@ -363,6 +364,7 @@ XBT_TEST_UNIT("nulldata", test_dict_nulldata, "NULL data management")
 }
 
 static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data) {
+       uintptr_t stored_data = 0;
   xbt_test_log2("Add %zu under %zu", data, key);
 
   xbt_dicti_set(head, key, data);
@@ -370,7 +372,7 @@ static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data) {
     xbt_dict_dump(head, (void (*)(void *)) &printf);
     fflush(stdout);
   }
-  uintptr_t stored_data = xbt_dicti_get(head, key);
+  stored_data = xbt_dicti_get(head, key);
   xbt_test_assert3(stored_data==data,
       "Retrieved data (%zu) is not what I just stored (%zu) under key %zu",stored_data,data,key);
 }
index 6791935..3c9b276 100644 (file)
@@ -13,7 +13,7 @@
 #define NB_ELEM 5000
 
 XBT_LOG_EXTERNAL_CATEGORY(xbt_dyn);
-XBT_LOG_DEFAULT_CATEGORY(xbt_dyn);
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dyn, xbt, "Dynamic arrays");
 
 XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
 {
index 442c3a2..0936822 100644 (file)
@@ -1294,7 +1294,7 @@ xbt_cfg_get_peer_at(xbt_cfg_t cfg, const char *name, int pos,
 #include "xbt.h"
 #include "xbt/ex.h"
 
-XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg);
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_cfg, xbt, "configuration support");
 
 XBT_TEST_SUITE("config", "Configuration support");
 
index 8d9fa7e..4f507cb 100644 (file)
@@ -811,7 +811,8 @@ static void dict_mallocator_reset_f(void *dict)
 #include "portable.h"
 
 XBT_LOG_EXTERNAL_CATEGORY(xbt_dict);
-XBT_LOG_DEFAULT_CATEGORY(xbt_dict);
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict, xbt,
+                                "Dictionaries provide the same functionalities than hash tables");
 
 XBT_TEST_SUITE("dict", "Dict data container");
 
@@ -1161,6 +1162,7 @@ XBT_TEST_UNIT("nulldata", test_dict_nulldata, "NULL data management")
 }
 
 static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data) {
+       uintptr_t stored_data = 0;
   xbt_test_log2("Add %zu under %zu", data, key);
 
   xbt_dicti_set(head, key, data);
@@ -1168,7 +1170,7 @@ static void debuged_addi(xbt_dict_t head, uintptr_t key, uintptr_t data) {
     xbt_dict_dump(head, (void (*)(void *)) &printf);
     fflush(stdout);
   }
-  uintptr_t stored_data = xbt_dicti_get(head, key);
+  stored_data = xbt_dicti_get(head, key);
   xbt_test_assert3(stored_data==data,
       "Retrieved data (%zu) is not what I just stored (%zu) under key %zu",stored_data,data,key);
 }
index 5770d7c..02a9a12 100644 (file)
@@ -717,7 +717,7 @@ XBT_INLINE void xbt_dynar_sort(xbt_dynar_t dynar, int_f_cpvoid_cpvoid_t compar_f
 
 XBT_TEST_SUITE("dynar", "Dynar data container");
 XBT_LOG_EXTERNAL_CATEGORY(xbt_dyn);
-XBT_LOG_DEFAULT_CATEGORY(xbt_dyn);
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dyn, xbt, "Dynamic arrays");
 
 XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
 {