MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / clone_test

Function clone_test

tests/system_test/clone_test.cpp:435–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433} // namespace
434
435auto clone_test() -> bool {
436 klog::Info("===== Clone System Test Start =====");
437
438 g_tests_completed = 0;
439 g_tests_failed = 0;
440
441 auto& task_mgr = TaskManagerSingleton::instance();
442
443 auto test1 = kstd::make_unique<TaskControlBlock>("TestCloneProcess", 10,
444 test_clone_process, nullptr);
445 task_mgr.AddTask(std::move(test1));
446
447 auto test2 = kstd::make_unique<TaskControlBlock>("TestCloneThread", 10,
448 test_clone_thread, nullptr);
449 task_mgr.AddTask(std::move(test2));
450
451 auto test3 = kstd::make_unique<TaskControlBlock>(
452 "TestCloneParentFlag", 10, test_clone_parent_flag, nullptr);
453 task_mgr.AddTask(std::move(test3));
454
455 auto test4 = kstd::make_unique<TaskControlBlock>(
456 "TestCloneFlagsAutoCompletion", 10, test_clone_flags_auto_completion,
457 nullptr);
458 task_mgr.AddTask(std::move(test4));
459
460 int timeout = 200;
461 while (timeout > 0) {
462 (void)sys_sleep(50);
463 if (g_tests_completed >= 4) {
464 break;
465 }
466 timeout--;
467 }
468
469 EXPECT_EQ(g_tests_completed, 4, "tests completed");
470 EXPECT_EQ(g_tests_failed, 0, "tests failed");
471
472 klog::Info("Clone System Test Suite: COMPLETED");
473 return true;
474}

Callers

nothing calls this directly

Calls 3

InfoFunction · 0.85
sys_sleepFunction · 0.85
AddTaskMethod · 0.80

Tested by

no test coverage detected