- dw_variable_t var;
- dw_type_t type;
-
- s_mc_process_t p;
- mc_process_t process = &p;
- MC_process_init(&p, getpid(), -1);
-
- test_global_variable(process, process->binary_info, "some_local_variable", &some_local_variable, sizeof(int));
-
- var = test_global_variable(process, process->binary_info, "test_some_array", &test_some_array, sizeof(test_some_array));
- type = (dw_type_t) xbt_dict_get_or_null(process->binary_info->types, var->type_origin);
- xbt_assert(type->element_count == 6*5*4, "element_count mismatch in test_some_array : %i / %i", type->element_count, 6*5*4);
-
- var = test_global_variable(process, process->binary_info, "test_some_struct", &test_some_struct, sizeof(test_some_struct));
- type = (dw_type_t) xbt_dict_get_or_null(process->binary_info->types, var->type_origin);
- assert(find_member(process->binary_info, "first", type)->offset == 0);
- assert(find_member(process->binary_info, "second", type)->offset
+ simgrid::mc::Variable* var;
+ simgrid::mc::Type* type;
+
+ simgrid::mc::Process process(getpid(), -1);
+ process.init();
+
+ test_global_variable(process, process.binary_info.get(),
+ "some_local_variable", &some_local_variable, sizeof(int));
+
+ var = test_global_variable(process, process.binary_info.get(),
+ "test_some_array", &test_some_array, sizeof(test_some_array));
+ auto i = process.binary_info->types.find(var->type_id);
+ xbt_assert(i != process.binary_info->types.end(), "Missing type");
+ type = &i->second;
+ xbt_assert(type->element_count == 6*5*4,
+ "element_count mismatch in test_some_array : %i / %i",
+ type->element_count, 6*5*4);
+
+ var = test_global_variable(process, process.binary_info.get(),
+ "test_some_struct", &test_some_struct, sizeof(test_some_struct));
+ i = process.binary_info->types.find(var->type_id);
+ xbt_assert(i != process.binary_info->types.end(), "Missing type");
+ type = &i->second;
+
+ assert(type);
+ assert(find_member(*type, "first")->offset() == 0);
+ assert(find_member(*type, "second")->offset()