FFmpeg  4.0
Macros | Functions
avstring.c File Reference
#include <stdio.h>
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/avstring.h"

Go to the source code of this file.

Macros

#define TEST_APPEND_PATH_COMPONENT(path, component, expected)
 
#define TEST_STRNSTR(haystack, needle, hay_length, expected)
 
#define TEST_STRIREPLACE(haystack, needle, expected)
 
#define TEST_D2STR(value, expected)
 

Functions

int main (void)
 

Macro Definition Documentation

◆ TEST_APPEND_PATH_COMPONENT

#define TEST_APPEND_PATH_COMPONENT (   path,
  component,
  expected 
)
Value:
fullpath = av_append_path_component((path), (component)); \
printf("%s = %s\n", fullpath ? fullpath : "(null)", expected); \
av_free(fullpath);
char * av_append_path_component(const char *path, const char *component)
Append path component to the existing path.
Definition: avstring.c:295

Referenced by main().

◆ TEST_STRNSTR

#define TEST_STRNSTR (   haystack,
  needle,
  hay_length,
  expected 
)
Value:
ptr = av_strnstr(haystack, needle, hay_length); \
if (ptr != expected){ \
printf("expected: %p, received %p\n", expected, ptr); \
}
char * av_strnstr(const char *haystack, const char *needle, size_t hay_length)
Locate the first occurrence of the string needle in the string haystack where not more than hay_lengt...
Definition: avstring.c:69

Referenced by main().

◆ TEST_STRIREPLACE

#define TEST_STRIREPLACE (   haystack,
  needle,
  expected 
)
Value:
ptr = av_strireplace(haystack, needle, "instead"); \
if (ptr == NULL) { \
printf("error, received null pointer!\n"); \
} else { \
if (strcmp(ptr, expected) != 0) \
printf( "expected: %s, received: %s\n", expected, ptr); \
av_free(ptr); \
}
#define NULL
Definition: coverity.c:32
char * av_strireplace(const char *str, const char *from, const char *to)
Locale-independent strings replace.
Definition: avstring.c:234

Referenced by main().

◆ TEST_D2STR

#define TEST_D2STR (   value,
  expected 
)
Value:
if((ptr = av_d2str(value)) == NULL){ \
printf("error, received null pointer!\n"); \
} else { \
if(strcmp(ptr, expected) != 0) \
printf( "expected: %s, received: %s\n", expected, ptr); \
av_free(ptr); \
}
#define NULL
Definition: coverity.c:32
char * av_d2str(double d)
Convert a number to an av_malloced string.
Definition: avstring.c:139
double value
Definition: eval.c:98

Referenced by main().

Function Documentation

◆ main()

int main ( void  )

Definition at line 25 of file avstring.c.