Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
By default, the output of floating point numbers by functions such as printf, wprintf...
authorcherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 27 Jun 2008 13:03:42 +0000 (13:03 +0000)
committercherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 27 Jun 2008 13:03:42 +0000 (13:03 +0000)
So I change this behavior by using the function _set_output_format. Otherwise tesh detect an output difference in test file relative with send/receive and priority samples.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5844 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/msg/priority/priority.c
examples/msg/sendrecv/sendrecv.c

index 135c2b7..291039d 100644 (file)
@@ -61,6 +61,11 @@ static MSG_error_t test_all(const char *platform_file,
 int main(int argc, char *argv[])
 {
   MSG_error_t res = MSG_OK;
 int main(int argc, char *argv[])
 {
   MSG_error_t res = MSG_OK;
+  
+  #ifdef _MSC_VER
+  unsigned int prev_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
+  #endif
+
 
   MSG_global_init(&argc,argv);
   if (argc < 3) {
 
   MSG_global_init(&argc,argv);
   if (argc < 3) {
@@ -70,6 +75,10 @@ int main(int argc, char *argv[])
   }
   res = test_all(argv[1],argv[2]);
   MSG_clean();
   }
   res = test_all(argv[1],argv[2]);
   MSG_clean();
+  
+  #ifdef _MSC_VER
+  _set_output_format(prev_exponent_format);
+  #endif
 
   if(res==MSG_OK)
     return 0;
 
   if(res==MSG_OK)
     return 0;
index 22720ab..0f5051f 100644 (file)
@@ -128,6 +128,8 @@ MSG_error_t test_all(const char *platform_file,
 
   MSG_error_t res = MSG_OK;
 
 
   MSG_error_t res = MSG_OK;
 
+  
+
   INFO0("test_all"); 
                        
   /*  Simulation setting */
   INFO0("test_all"); 
                        
   /*  Simulation setting */
@@ -142,6 +144,7 @@ MSG_error_t test_all(const char *platform_file,
   MSG_launch_application(application_file);
   
   res = MSG_main();
   MSG_launch_application(application_file);
   
   res = MSG_main();
+
   return res;
 } /* end_of_test_all */
 
   return res;
 } /* end_of_test_all */
 
@@ -150,7 +153,10 @@ MSG_error_t test_all(const char *platform_file,
 int main(int argc, char *argv[])
 {
   MSG_error_t res = MSG_OK;
 int main(int argc, char *argv[])
 {
   MSG_error_t res = MSG_OK;
-
+       
+  #ifdef _MSC_VER
+  unsigned int prev_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
+  #endif
   
   MSG_global_init(&argc,argv);
 
   
   MSG_global_init(&argc,argv);
 
@@ -176,6 +182,10 @@ int main(int argc, char *argv[])
 
   MSG_clean();
 
 
   MSG_clean();
 
+  #ifdef _MSC_VER
+  _set_output_format(prev_exponent_format);
+  #endif
+
   if(res==MSG_OK) return 0; 
   else return 1;
 } /* end_of_main */
   if(res==MSG_OK) return 0; 
   else return 1;
 } /* end_of_main */