Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
teshsuite: smpi: MBI: Merge change form MBI.
[simgrid.git] / teshsuite / smpi / MBI / RMAInvalidArgGenerator.py
index 6a5e40a..2ba7cf9 100755 (executable)
@@ -40,7 +40,7 @@ END_MBI_TESTS
 int main(int argc, char **argv) {
   int nprocs = -1 , rank = -1;
   MPI_Win win;
-  int *winbuf = @{malloc}@ // Window buffer
+  int *winbuf = (int *)@{malloc}@ // Window buffer
 
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
@@ -90,7 +90,7 @@ for e in gen.epoch:
         patterns['malloc'] = "malloc(N * sizeof(int));"
 
         # Generate a code with a null type
-        replace = patterns
+        replace = patterns.copy()
         replace['shortdesc'] = 'Invalid argument in one-sided operation.'
         replace['longdesc'] = 'A one-sided operation has MPI_DATATYPE_NULL as a type.'
         replace['outcome'] = 'ERROR: InvalidDatatype'
@@ -99,19 +99,19 @@ for e in gen.epoch:
         gen.make_file(template, f'InvalidParam_DatatypeNull_{e}_{p}_nok.c', replace)
 
         # Generate a code with a null buffer (move to RMAWinBufferGenerator)
-        # replace = patterns
+        # replace = patterns.copy()
         # replace['origin'] = 'MPI-Corrbench'
         # replace['shortdesc'] = 'nullptr is invalid in one-sided operation.'
         # replace['longdesc'] = 'A one-sided operation has an invalid buffer.'
         # replace['outcome'] = 'ERROR: InvalidBuffer'
-        # replace['init'] = 'int * localbuf1 = malloc(sizeof(int));'
+        # replace['init'] = 'int * localbuf1 = (int *)malloc(sizeof(int));'
         # replace['change_arg'] = 'localbuf1 = NULL;'
         # replace['operation'] = gen.operation[p]("1").replace('&localbuf1', 'localbuf1')
         # replace['errormsg'] = '@{p}@ at @{filename}@:@{line:MBIERROR}@ has an invalid buffer'
         # gen.make_file(template, f'InvalidParam_BufferNull_{e}_{p}_nok.c', replace)
 
         # Generate a code with an invalid type
-        replace = patterns
+        replace = patterns.copy()
         replace['origin'] = 'MBI'
         replace['shortdesc'] = 'Invalid argument in one-sided operation.'
         replace['longdesc'] = 'Use of an invalid datatype in one-sided operation.'
@@ -121,13 +121,14 @@ for e in gen.epoch:
         gen.make_file(template, f'InvalidParam_Datatype_{e}_{p}_nok.c', replace)
 
         # Generate a code with invalid buffer
-        replace = patterns
+        replace = patterns.copy()
         patterns['origin'] = "MPI-Corrbench"
         replace['shortdesc'] = 'Invalid invalid buffer (buffer must be allocated)'
         replace['longdesc'] = 'Use of an invalid buffer in MPI_Win_create.'
         replace['outcome'] = 'ERROR: InvalidBuffer'
-        patterns['malloc'] = "NULL; /* MBIERROR2 */"
-        patterns['operation'] = ""
+        replace['malloc'] = "NULL; /* MBIERROR2 */"
+        replace['init'] = ""
+        replace['operation'] = ""
         replace['change_arg'] = ""
         replace['errormsg'] = 'Invalid buffer in Win_create at @{filename}@:@{line:MBIERROR2}@'
         gen.make_file(template, f'InvalidParam_InvalidBufferWinCreate_{e}_{p}_nok.c', replace)