Skip to content

Commit

Permalink
add a test to process test suite
Browse files Browse the repository at this point in the history
not that there’s a point in this test really
  • Loading branch information
CamJN committed Sep 22, 2024
1 parent df6f2ac commit 48f430d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/cxx/Core/ApplicationPool/ProcessTest.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <TestSupport.h>
#include <Core/ApplicationPool/Process.h>
#include <Core/ApplicationPool/Group.h>
#include <LoggingKit/Context.h>
#include <FileTools/FileManip.h>

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 48f430d

Please sign in to comment.