================
@@ -33,3 +33,22 @@ def test_without_external_bit_set(self):
expected_string = "Test progress first increment"
progress.Increment(1, expected_string)
self.assertFalse(listener.PeekAtNextEvent(event))
+
+ def test_with_external_bit_set(self):
+ """Test SBProgress can handle null events."""
+
+ progress = lldb.SBProgress("Test SBProgress", "Test progress", 3,
self.dbg)
+ listener = lldb.SBListener("Test listener")
+ broadcaster = self.dbg.GetBroadcaster()
+ broadcaster.AddListener(listener, lldb.eBroadcastBitExternalProgress)
+ event = lldb.SBEvent()
+
+ progress.Increment(1, None)
+ self.assertTrue(listener.GetNextEvent(event))
+ progress.Increment(1, "")
+ self.assertTrue(listener.GetNextEvent(event))
+ progress.Increment(1, "Step 3")
+ self.assertTrue(listener.GetNextEvent(event))
+ stream = lldb.SBStream()
+ event.GetDescription(stream)
+ self.assertIn("Step 3", stream.GetData())
----------------
clayborg wrote:
can we test that we receive these events with the correct data here? (get the
start event, the 3 increment events with no detail for the first two and then
"Step 3" for the 3rd increment, though right now that might come through as an
end event?
https://github.com/llvm/llvm-project/pull/128971
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits