Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Increase coverage.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 4 Dec 2020 09:27:07 +0000 (10:27 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 4 Dec 2020 15:32:30 +0000 (16:32 +0100)
examples/smpi/ampi_test/ampi_test.cpp

index 78d132a..bc02cad 100644 (file)
 int main(int argc, char* argv[])
 {
   MPI_Init(&argc, &argv);
+  // useless alocations for testing and coverage
   void* pointer = malloc(100 * sizeof(int));
+  pointer       = realloc(pointer, 50 * sizeof(int));
+  pointer       = realloc(pointer, 200 * sizeof(int));
   free(pointer);
-  pointer = malloc(100 * sizeof(int));
+  pointer = calloc(100, sizeof(int));
   int rank;
   int err = MPI_Comm_rank(MPI_COMM_WORLD, &rank);   /* Get id of this process */
   if (err != MPI_SUCCESS) {