Makes this check work with musl >= 1.2.1
https://bugzilla.gnome.org/show_bug.cgi?id=736774
-bool success = false;
+int success = 0;
class Foo : Object {
~Foo() {
- success = true;
+ success++;
}
}
} catch {
}
- assert (success);
+ assert (success == 1);
}
-string* keep;
+int success = 0;
-string may_fail () throws GLib.Error {
- string result = "test";
- keep = result;
+[Compact]
+[Immutable]
+[CCode (free_function = "vstring_destroy")]
+public class vstring : string {
+ public vstring (string s);
+
+ [DestroysInstance]
+ public void destroy () {
+ free (this);
+ success++;
+ }
+}
+
+vstring may_fail () throws GLib.Error {
+ vstring result = (vstring) "test".dup ();
return (owned) result;
}
} catch {
}
- assert (keep != "test");
+ assert (success == 1);
}