summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-07-02 12:34:06 +0000
committerArne Juul <arnej@verizonmedia.com>2020-07-03 08:02:40 +0000
commitfca385ca81ea92e6b9dbbb0d1794cfafa35ababc (patch)
tree26704f07cf3c42e9e1a6856e7a23dd96519af2f0
parent0a309ca9dcba4fed2ba8e4c56230330859a70148 (diff)
avoid naked exit
-rw-r--r--staging_vespalib/src/tests/shutdownguard/shutdownguard_test.cpp3
-rw-r--r--vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp11
2 files changed, 7 insertions, 7 deletions
diff --git a/staging_vespalib/src/tests/shutdownguard/shutdownguard_test.cpp b/staging_vespalib/src/tests/shutdownguard/shutdownguard_test.cpp
index fbaa5581173..04a811494c9 100644
--- a/staging_vespalib/src/tests/shutdownguard/shutdownguard_test.cpp
+++ b/staging_vespalib/src/tests/shutdownguard/shutdownguard_test.cpp
@@ -3,6 +3,7 @@
#include <vespa/vespalib/util/shutdownguard.h>
#include <unistd.h>
#include <sys/wait.h>
+#include <cstdlib>
using namespace vespalib;
@@ -23,7 +24,7 @@ Test::Main()
for (int i = 0; i < 1000; ++i) {
std::this_thread::sleep_for(20ms);
}
- exit(0);
+ std::_Exit(0);
}
for (int i = 0; i < 1000; ++i) {
std::this_thread::sleep_for(20ms);
diff --git a/vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp b/vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp
index 3041627b2d0..0141e32e435 100644
--- a/vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp
+++ b/vespalib/src/tests/stllike/uniq_by_sort_map_hash.cpp
@@ -310,13 +310,13 @@ int main(int argc, char *argv[])
} else {
std::vector<pthread_t> threads(numThreads);
for (size_t j(0); j < numThreads; j++) {
- pthread_create(&threads[j], NULL, (VFUNC)runBenchMark, &indirectSlotVector);
+ pthread_create(&threads[j], NULL, (VFUNC)runBenchMark, &indirectSlotVector);
}
for (size_t j(0); j < numThreads; j++) {
pthread_join(threads[j], NULL);
}
}
- break;
+ break;
default:
printf("'m' = %s\n", description[type]);
printf("'M' = %s\n", description[type]);
@@ -327,11 +327,10 @@ int main(int argc, char *argv[])
printf("'g' = %s\n", description[type]);
printf("'G' = %s\n", description[type]);
printf("'J' = %s\n", description[type]);
- printf("Unspecified type %c. Running map benchmark\n", type);
- exit(1);
- break;
+ printf("Unspecified type %c.\n", type);
+ return 1;
}
}
printf("Running test '%c' = %s, result = %ld unique values\n", type, description[type], uniq);
+ return 0;
}
-