From e12e511deb7f7e495866ac5c4f33c5cce33f0446 Mon Sep 17 00:00:00 2001
From: Florian Schmaus <flow@cs.fau.de>
Date: Tue, 23 Mar 2021 15:47:15 +0100
Subject: [PATCH] [test] Remove unnecessary exit(EXIT_SUCCESS) in emperTest()

The test fixture will automatically assume that the test was
successful if emperTest() returns.
---
 tests/AlarmFutureTest.cpp           | 3 ---
 tests/CancelFutureTest.cpp          | 3 ---
 tests/IncrementalCompletionTest.cpp | 2 --
 tests/LinkFutureTest.cpp            | 3 ---
 tests/ReuseBpsTest.cpp              | 6 +-----
 tests/ReuseFutureTest.cpp           | 3 ---
 tests/TimeoutWrapperTest.cpp        | 3 ---
 tests/TooLongFutureChain.cpp        | 1 -
 tests/YieldToAnywhereTest.cpp       | 5 +----
 9 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/tests/AlarmFutureTest.cpp b/tests/AlarmFutureTest.cpp
index b14830a4..7ff4e6f2 100644
--- a/tests/AlarmFutureTest.cpp
+++ b/tests/AlarmFutureTest.cpp
@@ -4,7 +4,6 @@
 #include <cerrno>		// for ETIME
 #include <chrono>		// for microseconds, duration_cast, operator-
 #include <cstdint>	// for int32_t
-#include <cstdlib>	// for exit, EXIT_SUCCESS
 
 #include "emper-config.h"
 #include "io/Future.hpp"	// for AlarmFuture
@@ -28,6 +27,4 @@ void emperTest() {
 
 	assert(std::chrono::duration_cast<std::chrono::microseconds>(end - start) >=
 				 std::chrono::seconds(1));
-
-	exit(EXIT_SUCCESS);
 }
diff --git a/tests/CancelFutureTest.cpp b/tests/CancelFutureTest.cpp
index 21eaa79f..0ff9b09f 100644
--- a/tests/CancelFutureTest.cpp
+++ b/tests/CancelFutureTest.cpp
@@ -5,7 +5,6 @@
 #include <cassert>	// for assert
 #include <cerrno>		// for ECANCELED, ETIME
 #include <cstdint>	// for uint64_t, int32_t
-#include <cstdlib>	// for exit, EXIT_SUCCESS
 
 #include "Common.hpp"			// for DIE_MSG_ERRNO
 #include "io/Future.hpp"	// for ReadFuture, WriteFuture
@@ -57,6 +56,4 @@ void emperTest() {
 	int r = readFuture2.cancel();
 	assert(r == -EINTR || r == -ECANCELED);
 	assert(readFuture.wait() == sizeof(write_buf) && read_buf == write_buf);
-
-	exit(EXIT_SUCCESS);
 }
diff --git a/tests/IncrementalCompletionTest.cpp b/tests/IncrementalCompletionTest.cpp
index 229ce178..0f102fd6 100644
--- a/tests/IncrementalCompletionTest.cpp
+++ b/tests/IncrementalCompletionTest.cpp
@@ -48,6 +48,4 @@ void emperTest() {
 
 	delete[] memOut;
 	delete[] memIn;
-
-	exit(EXIT_SUCCESS);
 }
diff --git a/tests/LinkFutureTest.cpp b/tests/LinkFutureTest.cpp
index b9859ec5..f0f2d04d 100644
--- a/tests/LinkFutureTest.cpp
+++ b/tests/LinkFutureTest.cpp
@@ -8,7 +8,6 @@
 #include <cassert>	// for assert
 #include <cerrno>		// for EBADF, ECANCELED
 #include <cstdint>	// for uint64_t, int32_t
-#include <cstdlib>	// for exit, EXIT_SUCCESS
 
 #include "Common.hpp"	 // for DIE_MSG_ERRNO, DIE_MSG
 #include "io.hpp"
@@ -126,6 +125,4 @@ void emperTest() {
 	successLoop();
 	failureChainInvCor();
 	failureChainCorInvCor();
-
-	exit(EXIT_SUCCESS);
 }
diff --git a/tests/ReuseBpsTest.cpp b/tests/ReuseBpsTest.cpp
index 82d8a06a..7eddfb91 100644
--- a/tests/ReuseBpsTest.cpp
+++ b/tests/ReuseBpsTest.cpp
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: LGPL-3.0-or-later
-// Copyright © 2020 Florian Schmaus
-#include <cstdlib>	// for exit, EXIT_SUC...
-
+// Copyright © 2020-2021 Florian Schmaus
 #include "BinaryPrivateSemaphore.hpp"		 // for BPS
 #include "CountingPrivateSemaphore.hpp"	 // for CPS
 #include "emper.hpp"										 // for spawn
@@ -34,6 +32,4 @@ void emperTest() {
 
 	// Wait for the fibers to finish.
 	cps.wait();
-
-	exit(EXIT_SUCCESS);
 }
diff --git a/tests/ReuseFutureTest.cpp b/tests/ReuseFutureTest.cpp
index 50f01ad7..f08dccf0 100644
--- a/tests/ReuseFutureTest.cpp
+++ b/tests/ReuseFutureTest.cpp
@@ -4,7 +4,6 @@
 
 #include <cerrno>		// for errno
 #include <cstdint>	// for uint64_t, int32_t
-#include <cstdlib>	// for exit, EXIT_SUCCESS
 
 #include "Common.hpp"										 // for DIE_MSG_ERRNO
 #include "CountingPrivateSemaphore.hpp"	 // for CPS
@@ -65,6 +64,4 @@ void emperTest() {
 
 	// Wait for the fibers to finish.
 	cps.wait();
-
-	exit(EXIT_SUCCESS);
 }
diff --git a/tests/TimeoutWrapperTest.cpp b/tests/TimeoutWrapperTest.cpp
index 8211b376..ef7e3b36 100644
--- a/tests/TimeoutWrapperTest.cpp
+++ b/tests/TimeoutWrapperTest.cpp
@@ -5,7 +5,6 @@
 #include <cassert>	// for assert
 #include <cerrno>		// for ECANCELED, ETIME
 #include <cstdint>	// for uint64_t, int32_t
-#include <cstdlib>	// for exit, EXIT_SUCCESS
 
 #include "Common.hpp"			// for DIE_MSG_ERRNO
 #include "io/Future.hpp"	// for ReadFuture, TimeoutWrapper
@@ -30,6 +29,4 @@ void emperTest() {
 
 	res = readFuture.wait();
 	assert(res == -ECANCELED);
-
-	exit(EXIT_SUCCESS);
 }
diff --git a/tests/TooLongFutureChain.cpp b/tests/TooLongFutureChain.cpp
index 8f861e0a..7a1bb3ea 100644
--- a/tests/TooLongFutureChain.cpp
+++ b/tests/TooLongFutureChain.cpp
@@ -23,5 +23,4 @@ void emperTest() {
 	}
 
 	futures[links - 1]->submitAndWait();
-	exit(EXIT_SUCCESS);
 }
diff --git a/tests/YieldToAnywhereTest.cpp b/tests/YieldToAnywhereTest.cpp
index ee0fb8ef..e9248ca1 100644
--- a/tests/YieldToAnywhereTest.cpp
+++ b/tests/YieldToAnywhereTest.cpp
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: LGPL-3.0-or-later
-// Copyright © 2020 Florian Schmaus
-#include <cstdlib>
-
+// Copyright © 2020-2021 Florian Schmaus
 #include "CountingPrivateSemaphore.hpp"
 #include "emper.hpp"
 
@@ -18,5 +16,4 @@ void emperTest() {
 				cps);
 	}
 	cps.wait();
-	exit(EXIT_SUCCESS);
 }
-- 
GitLab