Browse Source

Make buf_datalen() mockable

Andrea Shepard 10 years ago
parent
commit
a2de0a1034
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/or/buffers.c
  2. 1 1
      src/or/buffers.h

+ 2 - 2
src/or/buffers.c

@@ -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;
 }

+ 1 - 1
src/or/buffers.h

@@ -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);