#include <stdio.h>
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/avstring.h"
 
Go to the source code of this file.
◆ TEST_APPEND_PATH_COMPONENT
      
        
          | #define TEST_APPEND_PATH_COMPONENT | 
          ( | 
            | 
          path,  | 
        
        
           | 
           | 
            | 
          component,  | 
        
        
           | 
           | 
            | 
          expected  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:
        printf("%s = %s\n", fullpath ? fullpath : "(null)", expected); \
        av_free(fullpath);
 
 
 
◆ TEST_STRNSTR
      
        
          | #define TEST_STRNSTR | 
          ( | 
            | 
          haystack,  | 
        
        
           | 
           | 
            | 
          needle,  | 
        
        
           | 
           | 
            | 
          hay_length,  | 
        
        
           | 
           | 
            | 
          expected  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:
        if (ptr != expected){ \
            printf("expected: %p, received %p\n", expected, ptr); \
        }
 
 
 
◆ TEST_STRIREPLACE
      
        
          | #define TEST_STRIREPLACE | 
          ( | 
            | 
          haystack,  | 
        
        
           | 
           | 
            | 
          needle,  | 
        
        
           | 
           | 
            | 
          expected  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:
            printf("error, received null pointer!\n"); \
        } else { \
            if (strcmp(ptr, expected) != 0) \
                printf( "expected: %s, received: %s\n", expected, ptr); \
            av_free(ptr); \
        }
 
 
 
◆ TEST_D2STR
      
        
          | #define TEST_D2STR | 
          ( | 
            | 
          value,  | 
        
        
           | 
           | 
            | 
          expected  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:
            printf("error, received null pointer!\n"); \
        } else { \
            if(strcmp(ptr, expected) != 0) \
                printf( "expected: %s, received: %s\n", expected, ptr); \
            av_free(ptr); \
        }
 
 
 
◆ main()
 
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...