-
Notifications
You must be signed in to change notification settings - Fork 35
Home
Orca edited this page Jan 26, 2018
·
6 revisions
Welcome to the mockcpp wiki!
完整的mock规范示例:
EMOCK(function / "function signature")
.stubs() / defaults() / expects(never() | once() | exactly(3) | atLeast(3) | atMost(3) )
[.before("some-mocker-id")]
[.with( any() | eq(3) | neq(3) | gt(3) | lt(3) | spy(var_out) | check(check_func)
| outBound(var_out) | outBoundP(var_out_addr, var_size) | mirror(var_in_addr, var_size)
| smirror(string) | contains(string) | startWith(string) | endWith(string) )]
[.after("some-mocker-id")]
.will( returnValue(1) | repeat(1, 20) | returnObjectList(r1, r2)
| invoke(func_stub) | ignoreReturnValue()
| increase(from, to) | increase(from) | throws(exception) | die(3) )
[.then(returnValue(2))]
[.id("some-mocker-id")]