woboq / qmetaobject-rs

Integrate Qml and Rust by building the QMetaObject at compile time.
MIT License
638 stars 89 forks source link

Some tests fail with Qt 6.5.3 #301

Open alois31 opened 1 year ago

alois31 commented 1 year ago

Using Qt version 6.5.3, the call_method and register_singleton_instance tests fail. Log:

---- call_method stdout ----
:0 [QtWarningMsg default ] WARNING: QApplication was not created in the main() thread.
:0 [QtWarningMsg default ] WARNING: QApplication was not created in the main() thread.
:0 [QtWarningMsg default ] WARNING: QApplication was not created in the main() thread.
thread 'call_method' panicked at 'assertion failed: do_test(obj,\n    r\"\n        Item {\n            function doTest() {\n                return _obj.concatenate_strings(123, 456, 789) == \'123456789\';\n            }\n        }\n        \")', qmetaobject/tests/tests.rs:151:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- register_singleton_instance stdout ----
:0 [QtWarningMsg default ] WARNING: QApplication was not created in the main() thread.
:7 [QtWarningMsg default ] <Unknown File>:7: Error: Unknown method return type: 
thread 'register_singleton_instance' panicked at 'assertion failed: do_test(obj,\n    r\"\n        import TestRegister 1.0;\n\n        Item {\n            function doTest() {\n                return RegisterSingletonInstanceObj.get_value() === 123;\n            }\n        }\n        \")', qmetaobject/tests/tests.rs:260:5

Further investigation shows that the trouble in the concatenate_string method is actually caused by c.toString() being empty. I'm not sure if the failures are actually related, but they somewhat seem (things being empty while they shouldn't be).