git-svn-id: https://svn.kapsi.fi/jpa/nanopb@945 e3a754e5-d11d-0410-8d38-ebb782a927b9
This commit is contained in:
@@ -9,3 +9,5 @@ clean:
|
|||||||
test_decode1: test_decode1.c $(DEPS)
|
test_decode1: test_decode1.c $(DEPS)
|
||||||
$(CC) $(CFLAGS) -o $@ $< ../pb_decode.c
|
$(CC) $(CFLAGS) -o $@ $< ../pb_decode.c
|
||||||
|
|
||||||
|
fuzztest: test_decode1
|
||||||
|
I=1; while cat /dev/urandom | ./test_decode1 > /dev/null; do I=$(($I+1)); echo -en "\r$I"; done
|
||||||
@@ -90,22 +90,6 @@ bool print_person(pb_istream_t *stream)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool my_read(pb_istream_t *stream, char *buf, size_t count)
|
|
||||||
{
|
|
||||||
char *source = (char*)stream->state;
|
|
||||||
|
|
||||||
if (!stream->bytes_left)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (buf != NULL)
|
|
||||||
{
|
|
||||||
memcpy(buf, source, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
stream->state = source + count;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
uint8_t buffer[512];
|
uint8_t buffer[512];
|
||||||
|
|||||||
Reference in New Issue
Block a user