Embedded Artistry Framework
Embedded Systems C++ Framework
Macros | Functions
strstr.c File Reference
#include "string_tests.h"
#include <string.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <cmocka.h>
Include dependency graph for strstr.c:

Macros

#define N(s, sub)
 
#define T(s, sub, n)
 

Functions

static void strstr_test (void **state)
 
int strstr_tests (void)
 

Macro Definition Documentation

◆ N

#define N (   s,
  sub 
)
Value:
{ \
const char* p = s; \
char* q = strstr(p, sub); \
assert_ptr_equal(q, NULL); \
}
char * strstr(const char *string, const char *substring)
Finds the first occurrence of the substring in the string.
Definition: strstr.c:38
static const char * s[]
Definition: heapsort.c:22
#define NULL
Definition: test_suite.cpp:15
static void * p[ALLOCATION_TEST_COUNT]
Definition: malloc_freelist.c:21

◆ T

#define T (   s,
  sub,
  n 
)
Value:
{ \
const char* p = s; \
char* q = strstr(p, sub); \
assert_ptr_not_equal(q, NULL); \
assert_int_equal((intptr_t)(q - p), (intptr_t)n); \
}
char * strstr(const char *string, const char *substring)
Finds the first occurrence of the substring in the string.
Definition: strstr.c:38
long intptr_t
Definition: _intptr_t.h:4
static const char * s[]
Definition: heapsort.c:22
#define NULL
Definition: test_suite.cpp:15
static int n[]
Definition: heapsort.c:32
static void * p[ALLOCATION_TEST_COUNT]
Definition: malloc_freelist.c:21

Function Documentation

◆ strstr_test()

static void strstr_test ( void **  state)
static

References N, and T.

Referenced by strstr_tests().

◆ strstr_tests()

int strstr_tests ( void  )

References NULL, and strstr_test().

Referenced by string_tests().

Here is the caller graph for this function: