geary/subprojects/vala-unit/test
Niels De Graef 81859bd3c3 Adapt vala-unit and tests to GLib 2.70 and later
`GLib.TestSuite` is a special type of object, as it doesn't actually
have an associated copy function or a reference/unreference function.
In practice, that actually means there's no way to actually have 2
strong references to such an object, or to copy it somehow. Due to the
way GObject properties in Vala work, that means you can't really use
them either.

Ever since vala commit 5f0a146f65, this got reflected properly in the
internally maintained GLib VAPI (as people were experiencing double
frees otherwise), but it was added only conditionally for GLib 2.70 or
later. In practice, that means you only get vala compiler issues if you
(impliclty) set `--target-glib=2.70` (or a later version).

To fix this for vala-unit and our own Geary tests, this commit changes
the `ValaUnit.TestCase` class to only allow "stealing" the strong
reference to the `GLib.TestSuite`, rather than somehowing allowing
people to hold a weak reference, and by also making it a protected field
rather than a property.

Since this changes the API of ValaUnit, we also bump the version. In
general though, I hope people aren't using ValaUnit externally, since
these types of API/ABI breaks can happen with Vala libraries.

Link: 5f0a146f65
2025-12-07 11:37:22 +01:00
..
collection-assertions.vala vala-unit: Skip gee collection in older valac 2020-06-30 17:31:07 +10:00
test-assertions.vala Move generic unit test classes to a new basically-standalone subproject 2020-06-30 17:20:12 +10:00
test-driver.vala Adapt vala-unit and tests to GLib 2.70 and later 2025-12-07 11:37:22 +01:00