|
@@ -12,16 +12,12 @@
|
|
|
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
// PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
-#ifndef __ISC_TESTUTILS_RESOURCE_H
|
|
|
-#define __ISC_TESTUTILS_RESOURCE_H
|
|
|
-
|
|
|
-#include <sys/time.h>
|
|
|
-#include <sys/resource.h>
|
|
|
-
|
|
|
-#include <gtest/gtest.h>
|
|
|
+#ifndef __UTIL_UNITTESTS_RESOURCE_H
|
|
|
+#define __UTIL_UNITTESTS_RESOURCE_H 1
|
|
|
|
|
|
namespace isc {
|
|
|
-namespace testutils {
|
|
|
+namespace util {
|
|
|
+namespace unittests {
|
|
|
|
|
|
/// Don't create core dumps.
|
|
|
///
|
|
@@ -30,29 +26,14 @@ namespace testutils {
|
|
|
/// is used, where processes abort (and create cores in the process).
|
|
|
/// As a new process is forked to run EXPECT_DEATH tests, the rlimits of
|
|
|
/// the parent process that runs the other tests should be unaffected.
|
|
|
-///
|
|
|
-/// This function definition is in the header file as otherwise there'd
|
|
|
-/// be a circular dependency from
|
|
|
-/// testutils->asiolink->log->testutils. See bug #1880.
|
|
|
-
|
|
|
-namespace {
|
|
|
-
|
|
|
-inline void
|
|
|
-dontCreateCoreDumps(void)
|
|
|
-{
|
|
|
- /* Set rlimits so that no coredumps are created. As a new
|
|
|
- process is forked to run this EXPECT_DEATH test, the rlimits
|
|
|
- of the parent process that runs the other tests should be
|
|
|
- unaffected. */
|
|
|
+void dontCreateCoreDumps();
|
|
|
|
|
|
- rlimit core_limit = {0, 0};
|
|
|
-
|
|
|
- EXPECT_EQ(setrlimit(RLIMIT_CORE, &core_limit), 0);
|
|
|
-}
|
|
|
-
|
|
|
-} // end of anonymous namespace
|
|
|
-
|
|
|
-} // end of namespace testutils
|
|
|
+} // end of namespace unittests
|
|
|
+} // end of namespace util
|
|
|
} // end of namespace isc
|
|
|
|
|
|
-#endif /* __ISC_TESTUTILS_RESOURCE_H */
|
|
|
+#endif /* __UTIL_UNITTESTS_RESOURCE_H */
|
|
|
+
|
|
|
+// Local Variables:
|
|
|
+// mode: c++
|
|
|
+// End:
|