Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Don't name unused exceptions.
[simgrid.git] / teshsuite / xbt / mmalloc / mmalloc_test.cpp
index 1d2eeae..1220c58 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2012-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -17,8 +17,9 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test,"this test");
 
-#define BUFFSIZE 204800
-#define TESTSIZE 100
+constexpr int BUFFSIZE = 204800;
+constexpr int TESTSIZE = 100;
+
 #define size_of_block(i) (((i % 50)+1)* 100)
 
 static void check_block(const void* s, int c, int n)
@@ -76,7 +77,7 @@ int main(int argc, char**argv)
     mfree(heapA, pointers[i]);
     try {
       mfree(heapA, pointers[i]);
-    } catch(xbt_ex& e) {
+    } catch (const xbt_ex&) {
       gotit = true;
     }
     if (not gotit)
@@ -88,7 +89,7 @@ int main(int argc, char**argv)
     bool gotit = false;
     try {
       mfree(heapA, pointers[i]);
-    } catch(xbt_ex& e) {
+    } catch (const xbt_ex&) {
       gotit = true;
     }
     if (not gotit)