MOS Source Code
Loading...
Searching...
No Matches
encode_unittests.c File Reference
#include "pb_common.c"
#include "pb_encode.c"
#include <stdio.h>
#include <string.h>
#include "unittests.h"
#include "unittestproto.pb.h"
+ Include dependency graph for encode_unittests.c:

Go to the source code of this file.

Macros

#define WRITES(x, y)
 

Functions

bool streamcallback (pb_ostream_t *stream, const uint8_t *buf, size_t count)
 
bool fieldcallback (pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
 
bool crazyfieldcallback (pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
 
int main ()
 

Macro Definition Documentation

◆ WRITES

#define WRITES ( x,
y )
Value:
memset(buffer, 0xAA, sizeof(buffer)), \
(x) && \
memcmp(buffer, y, sizeof(y) - 1) == 0 && \
buffer[sizeof(y) - 1] == 0xAA
MOSAPI int memcmp(const void *s1, const void *s2, size_t n)
Definition mos_string.c:142
pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize)
Definition pb_encode.c:63
static void * memset(void *s, int c, size_t n)
Definition pb_syshdr.h:101
static char buffer[2048]
Definition test_printf.c:7

Definition at line 42 of file encode_unittests.c.

Referenced by main().

Function Documentation

◆ streamcallback()

bool streamcallback ( pb_ostream_t * stream,
const uint8_t * buf,
size_t count )

Definition at line 10 of file encode_unittests.c.

Referenced by main().

◆ fieldcallback()

bool fieldcallback ( pb_ostream_t * stream,
const pb_field_t * field,
void *const * arg )

Definition at line 21 of file encode_unittests.c.

Referenced by main().

+ Here is the call graph for this function:

◆ crazyfieldcallback()

bool crazyfieldcallback ( pb_ostream_t * stream,
const pb_field_t * field,
void *const * arg )

Definition at line 29 of file encode_unittests.c.

Referenced by main().

+ Here is the call graph for this function:

◆ main()

int main ( void )

Definition at line 49 of file encode_unittests.c.

+ Here is the call graph for this function: