Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.112.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : JourneyTest.cpp
#include <TestSupport.h>
#include <Core/SpawningKit/Journey.h>

using namespace Passenger;
using namespace Passenger::SpawningKit;

namespace tut {
	struct Core_SpawningKit_JourneyTest: public TestBase {
	};

	DEFINE_TEST_GROUP(Core_SpawningKit_JourneyTest);

	TEST_METHOD(1) {
		set_test_name("Constructing a SPAWN_DIRECTLY journey results in"
			" the appropriate steps being defined in the journey");
		Journey journey(SPAWN_DIRECTLY, true);
		ensure("(1)", journey.hasStep(SPAWNING_KIT_PREPARATION));
		ensure("(2)", journey.hasStep(SUBPROCESS_EXEC_WRAPPER));
		ensure("(3)", !journey.hasStep(SPAWNING_KIT_CONNECT_TO_PRELOADER));
		ensure("(4)", !journey.hasStep(SUBPROCESS_PREPARE_AFTER_FORKING_FROM_PRELOADER));
	}

	TEST_METHOD(2) {
		set_test_name("Constructing a START_PRELOADER journey results in"
			" the appropriate steps being defined in the journey");
		Journey journey(START_PRELOADER, true);
		ensure("(1)", journey.hasStep(SPAWNING_KIT_PREPARATION));
		ensure("(2)", journey.hasStep(SUBPROCESS_EXEC_WRAPPER));
		ensure("(3)", !journey.hasStep(SPAWNING_KIT_CONNECT_TO_PRELOADER));
		ensure("(4)", !journey.hasStep(SUBPROCESS_PREPARE_AFTER_FORKING_FROM_PRELOADER));
	}

	TEST_METHOD(3) {
		set_test_name("Constructing a SPAWN_THROUGH_PRELOADER journey results in"
			" the appropriate steps being defined in the journey");
		Journey journey(SPAWN_THROUGH_PRELOADER, true);
		ensure("(1)", journey.hasStep(SPAWNING_KIT_PREPARATION));
		ensure("(2)", !journey.hasStep(SUBPROCESS_BEFORE_FIRST_EXEC));
		ensure("(3)", journey.hasStep(SPAWNING_KIT_CONNECT_TO_PRELOADER));
		ensure("(4)", journey.hasStep(SUBPROCESS_PREPARE_AFTER_FORKING_FROM_PRELOADER));
	}
}
© 2025 XylotrechusZ