Make buf_datalen() mockable

This commit is contained in:
Andrea Shepard 2014-01-23 06:42:14 -08:00
parent 8719f8ff09
commit a2de0a1034
2 changed files with 3 additions and 3 deletions

View File

@ -559,8 +559,8 @@ buf_clear(buf_t *buf)
}
/** Return the number of bytes stored in <b>buf</b> */
size_t
buf_datalen(const buf_t *buf)
MOCK_IMPL(size_t,
buf_datalen, (const buf_t *buf))
{
return buf->datalen;
}

View File

@ -24,7 +24,7 @@ void buf_shrink(buf_t *buf);
size_t buf_shrink_freelists(int free_all);
void buf_dump_freelist_sizes(int severity);
size_t buf_datalen(const buf_t *buf);
MOCK_DECL(size_t, buf_datalen, (const buf_t *buf));
size_t buf_allocation(const buf_t *buf);
size_t buf_slack(const buf_t *buf);