| 689 | #ifdef US_ENABLE_THREADING_SUPPORT |
| 690 | |
| 691 | TEST(ServiceTrackerTests, TestServiceTrackerDeadlock) |
| 692 | { |
| 693 | Framework framework = FrameworkFactory().NewFramework(); |
| 694 | framework.Start(); |
| 695 | |
| 696 | ServiceTracker<MyInterfaceOne> tracker(framework.GetBundleContext()); |
| 697 | tracker.Open(); |
| 698 | auto f = std::async( |
| 699 | [&framework] |
| 700 | { |
| 701 | // technically there's a race here, so the async should ensure WaitForService is started prior to |
| 702 | // terminating the framework. |
| 703 | std::this_thread::sleep_for(std::chrono::seconds(1)); |
| 704 | |
| 705 | framework.Stop(); |
| 706 | framework.WaitForStop(std::chrono::milliseconds::zero()); |
| 707 | }); |
| 708 | |
| 709 | ASSERT_THROW(tracker.WaitForService(), std::logic_error); |
| 710 | } |
| 711 | |
| 712 | TEST(ServiceTrackerTests, TestServiceTrackerInvalidBundle) |
| 713 | { |
nothing calls this directly
no test coverage detected