Add support for uint args in expected calls in MockObject

This commit is contained in:
Michael Gratton 2019-06-11 07:24:17 +10:00 committed by Michael James Gratton
parent bc64cd9847
commit 91caff487b

View file

@ -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<ExpectedCall> expected { get; set; }