From 91caff487bc39821768fd39e9b621ecee3383b3a Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Tue, 11 Jun 2019 07:24:17 +1000 Subject: [PATCH] Add support for uint args in expected calls in MockObject --- test/mock-object.vala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/mock-object.vala b/test/mock-object.vala index 8c97a745..c684c8a7 100644 --- a/test/mock-object.vala +++ b/test/mock-object.vala @@ -44,6 +44,21 @@ private class IntArgument : Object, Argument { } +private class UintArgument : Object, Argument { + + private uint value; + + internal UintArgument(uint value) { + this.value = value; + } + + public new void assert(Object object) throws Error { + assert_true(object is UintArgument, "Expected uint value"); + assert_uint(this.value, ((UintArgument) object).value); + } + +} + /** * Represents an expected method call on a mock object. * @@ -145,6 +160,10 @@ public interface MockObject { return new IntArgument(value); } + public static Object uint_arg(uint value) { + return new UintArgument(value); + } + protected abstract Gee.Queue expected { get; set; }