unittests (some)

git-svn-id: https://svn.kapsi.fi/jpa/nanopb@949 e3a754e5-d11d-0410-8d38-ebb782a927b9
This commit is contained in:
Petteri Aimonen
2011-07-30 09:59:08 +00:00
parent d7863b7424
commit f8364310d3
5 changed files with 145 additions and 24 deletions

View File

@@ -23,13 +23,14 @@ const pb_decoder_t PB_DECODERS[PB_LTYPES_COUNT] = {
bool pb_read(pb_istream_t *stream, uint8_t *buf, size_t count)
{
bool status;
if (stream->bytes_left < count)
return false;
status = stream->callback(stream, buf, count);
if (!stream->callback(stream, buf, count))
return false;
stream->bytes_left -= count;
return status;
return true;
}
static bool buf_read(pb_istream_t *stream, uint8_t *buf, size_t count)