Open elijah-semyonov opened 1 month ago
This test fails:
func testObjectArrayAcceptsNil() { let array = GArray(Object.self) array.append(Variant()) array.append(Variant()) XCTAssertEqual(array.count, 2) XCTAssertEqual(array[0], Variant()) XCTAssertEqual(array[1], Variant()) array.append(Variant(Object())) XCTAssertEqual(array.count, 3) }
Console prints:
Attempted to push_back an invalid (previously freed?) object instance into a 'TypedArray.
This crashes:
func testObjectNotLost() { let variant = Variant(Object()) let methodListVariant: Variant switch variant.call(method: "get_method_list") { case .success(let variant): methodListVariant = variant case .failure(let error): XCTFail("Could not get method list, error: \(error)") return } guard let methodList = GArray(methodListVariant) else { XCTFail("Could not get method list, got \(methodListVariant.gtype) instead") return } XCTAssertFalse(methodList.isEmpty()) }
Note: Only framework types are affected RefCounted-inherited types are not affected
This test fails:
Console prints:
This crashes:
Note: Only framework types are affected RefCounted-inherited types are not affected