diff options
| author | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
|---|---|---|
| committer | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
| commit | 74aecd8b0986d07b50b7ce310d64e645b8b54e38 (patch) | |
| tree | 560e6434f183eb54cd779936f3a4c9575146a066 /xmpp-vala/tests/common.vala | |
| parent | 3d7e90d401da02d430a87db0ec7e1db3a6f1a68f (diff) | |
| parent | 4436001bb361ad4f9e4e05819214ecf0ea77c063 (diff) | |
Merge 'upstream/master'
Diffstat (limited to 'xmpp-vala/tests/common.vala')
| -rw-r--r-- | xmpp-vala/tests/common.vala | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xmpp-vala/tests/common.vala b/xmpp-vala/tests/common.vala index 5bd7bbb6..978bca62 100644 --- a/xmpp-vala/tests/common.vala +++ b/xmpp-vala/tests/common.vala @@ -7,6 +7,7 @@ int main(string[] args) { TestSuite.get_root().add_suite(new Xmpp.Test.UtilTest().get_suite()); TestSuite.get_root().add_suite(new Xmpp.Test.JidTest().get_suite()); TestSuite.get_root().add_suite(new Xmpp.Test.ColorTest().get_suite()); + TestSuite.get_root().add_suite(new Xmpp.Test.WeakMapTest().get_suite()); return GLib.Test.run(); } @@ -23,9 +24,9 @@ void fail_if_reached(string? reason = null) { fail_if(true, reason); } -delegate void ErrorFunc() throws Error; +public delegate void ErrorFunc() throws Error; -void fail_if_not_error_code(ErrorFunc func, int expectedCode, string? reason = null) { +public void fail_if_not_error_code(ErrorFunc func, int expectedCode, string? reason = null) { try { func(); fail_if_reached(@"$(reason + ": " ?? "")no error thrown"); @@ -103,20 +104,20 @@ bool fail_if_eq_str(string? left, string? right, string? reason = null) { return fail_if(!nullcheck && left == right, @"$(reason + ": " ?? "")'$left' == '$right'"); } -bool fail_if_not_eq_uint8_arr(uint8[] left, uint8[] right, string? reason = null) { +public bool fail_if_not_eq_uint8_arr(uint8[] left, uint8[] right, string? reason = null) { if (fail_if_not_eq_int(left.length, right.length, @"$(reason + ": " ?? "")array length not equal")) return true; return fail_if_not_eq_str(Base64.encode(left), Base64.encode(right), reason); } -bool fail_if_not_zero_int(int zero, string? reason = null) { +public bool fail_if_not_zero_int(int zero, string? reason = null) { return fail_if_not_eq_int(zero, 0, reason); } -bool fail_if_zero_int(int zero, string? reason = null) { +public bool fail_if_zero_int(int zero, string? reason = null) { return fail_if_eq_int(zero, 0, reason); } -bool fail_if_null(void* what, string? reason = null) { +public bool fail_if_null(void* what, string? reason = null) { return fail_if(what == null || (size_t)what == 0, reason); } |
