From 48f430d194481dadbe95ca59a980c00bcc602904 Mon Sep 17 00:00:00 2001 From: Camden Narzt Date: Sun, 22 Sep 2024 14:40:02 -0600 Subject: [PATCH] add a test to process test suite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit not that there’s a point in this test really --- test/cxx/Core/ApplicationPool/ProcessTest.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/cxx/Core/ApplicationPool/ProcessTest.cpp b/test/cxx/Core/ApplicationPool/ProcessTest.cpp index b9d6c0727b..06b24897c4 100644 --- a/test/cxx/Core/ApplicationPool/ProcessTest.cpp +++ b/test/cxx/Core/ApplicationPool/ProcessTest.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -119,7 +120,7 @@ namespace tut { args["spawner_creation_time"] = 0; Process *p = context.processObjectPool.malloc(); - p = new (p) Process(&groupInfo, 0, result, args); + p = new (p) Process(&groupInfo, groupInfo.group->restartsInitiated, result, args); ProcessPtr process(p, false); process->shutdownNotRequired(); @@ -240,4 +241,15 @@ namespace tut { && contents.find("stdout and err 4\n") != string::npos; ); } + + TEST_METHOD(6) { + set_test_name("Test generation is inherited from pool at construction time"); + // this test is pointless b/c the process is made at line 123 of this file, not in the regular codebase + ProcessPtr process1 = createProcess(); + ensure_equals(process1->generation, groupInfo.group->restartsInitiated); + groupInfo.group->restartsInitiated++; + ProcessPtr process2 = createProcess(); + ensure_equals(process2->generation, groupInfo.group->restartsInitiated); + ensure(process1->generation != process2->generation); + } }