From 24b3afa684e57176f5068fd5896679ae0fa047ad Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 9 Jan 2023 11:29:22 +0100 Subject: Add process.h: is_running() --- tests/test-process.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/test-process.cpp (limited to 'tests/test-process.cpp') diff --git a/tests/test-process.cpp b/tests/test-process.cpp new file mode 100644 index 0000000..dfee83f --- /dev/null +++ b/tests/test-process.cpp @@ -0,0 +1,34 @@ +#include + +#include "process.h" + +#include + +class ProcessTest: public ::testing::Test +{ +protected: + ProcessTest(){ + } + + ~ProcessTest() override{ + } + + void SetUp() override + { + } + + void TearDown() override + { + } + +}; + +TEST_F(ProcessTest,is_running) { + auto pid{::getpid()}; + + EXPECT_NE(pid, -1); + + EXPECT_EQ(Reichwein::Process::is_running(pid), true); + + EXPECT_EQ(Reichwein::Process::is_running(999999999), false); +} -- cgit v1.2.3