@@ -44,10 +44,8 @@ class TestSystemConfig : public fly::SystemConfig
44
44
CATCH_TEST_CASE (" SystemMonitor" , " [system]" )
45
45
{
46
46
auto task_runner = fly::test::WaitableSequencedTaskRunner::create (fly::test::task_manager ());
47
-
48
- auto monitor =
49
- std::make_shared<fly::SystemMonitorImpl>(task_runner, std::make_shared<TestSystemConfig>());
50
- CATCH_REQUIRE (monitor->start ());
47
+ auto monitor = fly::SystemMonitor::create (task_runner, std::make_shared<TestSystemConfig>());
48
+ CATCH_REQUIRE (monitor);
51
49
52
50
// Wait for one poll to complete before proceeding.
53
51
task_runner->wait_for_task_to_complete (s_system_monitor_file);
@@ -89,21 +87,15 @@ CATCH_TEST_CASE("SystemMonitor", "[system]")
89
87
{
90
88
fly::test::MockSystem mock (fly::test::MockCall::Read);
91
89
92
- monitor = std::make_shared<fly::SystemMonitorImpl>(
93
- task_runner,
94
- std::make_shared<fly::SystemConfig>());
95
-
96
- CATCH_CHECK_FALSE (monitor->start ());
97
- CATCH_CHECK (monitor->get_system_cpu_count () == 0 );
90
+ monitor = fly::SystemMonitor::create (task_runner, std::make_shared<fly::SystemConfig>());
91
+ CATCH_CHECK_FALSE (monitor);
98
92
}
99
93
100
94
CATCH_SECTION (" Cannot update system CPU when ::read() fails" )
101
95
{
102
- monitor = std::make_shared<fly::SystemMonitorImpl>(
103
- task_runner,
104
- std::make_shared<fly::SystemConfig>());
96
+ monitor = fly::SystemMonitor::create (task_runner, std::make_shared<fly::SystemConfig>());
97
+ CATCH_REQUIRE (monitor);
105
98
106
- CATCH_CHECK (monitor->start ());
107
99
task_runner->wait_for_task_to_complete (s_system_monitor_file);
108
100
109
101
fly::test::MockSystem mock (fly::test::MockCall::Read);
@@ -124,11 +116,9 @@ CATCH_TEST_CASE("SystemMonitor", "[system]")
124
116
125
117
CATCH_SECTION (" Cannot update process CPU when ::times() fails" )
126
118
{
127
- monitor = std::make_shared<fly::SystemMonitorImpl>(
128
- task_runner,
129
- std::make_shared<fly::SystemConfig>());
119
+ monitor = fly::SystemMonitor::create (task_runner, std::make_shared<fly::SystemConfig>());
120
+ CATCH_REQUIRE (monitor);
130
121
131
- CATCH_CHECK (monitor->start ());
132
122
task_runner->wait_for_task_to_complete (s_system_monitor_file);
133
123
134
124
fly::test::MockSystem mock (fly::test::MockCall::Times);
0 commit comments