MCPcopy
hub / github.com/go-qml/qml / TestRegisterConverterPlainObject

Method TestRegisterConverterPlainObject

qml_test.go:312–338  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

310}
311
312func (s *S) TestRegisterConverterPlainObject(c *C) {
313 qml.RegisterConverter("PlainTestType", func(engine *qml.Engine, obj qml.Object) interface{} {
314 c.Check(engine, Equals, s.engine)
315 c.Check(obj.String("plainType"), Matches, "(const )?PlainTestType[&*]?")
316 c.Check(obj.Property("plainAddr"), FitsTypeOf, uintptr(0))
317 c.Check(cpptest.PlainTestTypeN(obj), Equals, 42)
318 return "<converted>"
319 })
320 obj := cpptest.NewTestType(s.engine)
321 defer obj.Destroy()
322
323 var calls int
324 obj.On("plainEmittedCpy", func(s string) {
325 c.Check(s, Equals, "<converted>")
326 calls++
327 })
328 obj.On("plainEmittedRef", func(s string) {
329 c.Check(s, Equals, "<converted>")
330 calls++
331 })
332 obj.On("plainEmittedPtr", func(s string) {
333 c.Check(s, Equals, "<converted>")
334 calls++
335 })
336 obj.Call("emitPlain")
337 c.Assert(calls, Equals, 3)
338}
339
340func (s *S) TestIssue84(c *C) {
341 // Regression test for issue #84 (QTBUG-41193).

Callers

nothing calls this directly

Calls 5

StringMethod · 0.65
PropertyMethod · 0.65
DestroyMethod · 0.65
OnMethod · 0.65
CallMethod · 0.65

Tested by

no test coverage detected