ztring.c: A few important extension for <string.h>
 All Classes Files Functions Variables Enumerator Friends Macros
Macros | Functions
test_ztring.c File Reference

Test program for ztring extensions to <string.h> More...

#include "uUnit.h"
#include "ztring.h"
#include <stdio.h>

Go to the source code of this file.

Macros

#define pr_str(NAME)
 
#define pr_num(NAME)   printf( "(%d)->" #NAME " == %d\n" , __LINE__, NAME )
 
#define ZS(x)   sizeof(x),x /* Shortcut macro */
 
#define ZS(x)   x
 
#define ztrcpy(dest, src)   strcpy(dest,src)
 
#define ztrcat(dest, src)   strcat(dest,src)
 
#define ZS(x)   sizeof(x),x /* Shortcut macro */
 
#define ZS(x)   sizeof(x),x /* Shortcut macro */
 
#define DIM(V)   (sizeof(V) / sizeof(*V)) /* *V == *(V+0) == V[0] */
 
#define do_test(NAME)   printf( "test->" #NAME "()\n" ); test_##NAME()
 

Functions

int eqstr (const char *a, const char *b)
 a==b? More...
 
void test_ztrcpy ()
 test->ztrcpy() More...
 
void test_ztrcat ()
 test->ztrcat() More...
 
void test_ztrins ()
 test->ztrins() More...
 
void test_strdel ()
 test->strdel() More...
 
void test_ztrsub ()
 test->ztrsub() More...
 
void test_strltrim ()
 test->strltrim() More...
 
void test_strrtrim ()
 test->strrtrim() More...
 
void test_strtrim ()
 test->strtrim() More...
 
void test_memczap ()
 Test->memczap() More...
 
void test_strpfx ()
 test->strpfx() More...
 
void test_strsffx ()
 test->strsffx() More...
 
void test_strrspn ()
 test->strrspn() More...
 
void test_strxltn1 ()
 test->strxltn1() More...
 
void test_zsize1 ()
 test -> (size==1) ==> *dest=0 forall( ztr???() ) More...
 
void test_subindex ()
 test -> "string"[0] == 's' ??? More...
 
int main ()
 

Detailed Description

Test program for ztring extensions to <string.h>

Author
Adolfo Di Mare adolf.nosp@m.o@di.nosp@m.-mare.nosp@m..com
Date
2014

Definition in file test_ztring.c.

Macro Definition Documentation

#define pr_str (   NAME)
Value:
printf( "(%d)->" #NAME " == \"%s\"[%d]\n" ,\
__LINE__, (char*)(NAME), strlen(NAME) )

Definition at line 14 of file test_ztring.c.

#define pr_num (   NAME)    printf( "(%d)->" #NAME " == %d\n" , __LINE__, NAME )

Definition at line 16 of file test_ztring.c.

#define ZS (   x)    sizeof(x),x /* Shortcut macro */
#define ZS (   x)    x
#define ztrcpy (   dest,
  src 
)    strcpy(dest,src)
#define ztrcat (   dest,
  src 
)    strcat(dest,src)
#define ZS (   x)    sizeof(x),x /* Shortcut macro */
#define ZS (   x)    sizeof(x),x /* Shortcut macro */
#define DIM (   V)    (sizeof(V) / sizeof(*V)) /* *V == *(V+0) == V[0] */
#define do_test (   NAME)    printf( "test->" #NAME "()\n" ); test_##NAME()

Function Documentation

int eqstr ( const char *  a,
const char *  b 
)

a==b?

Definition at line 20 of file test_ztring.c.

void test_ztrcpy ( )

test->ztrcpy()

Definition at line 25 of file test_ztring.c.

void test_ztrcat ( )

test->ztrcat()

Definition at line 107 of file test_ztring.c.

void test_ztrins ( )

test->ztrins()

Definition at line 169 of file test_ztring.c.

void test_strdel ( )

test->strdel()

Definition at line 471 of file test_ztring.c.

void test_ztrsub ( )

test->ztrsub()

Definition at line 521 of file test_ztring.c.

void test_strltrim ( )

test->strltrim()

Definition at line 554 of file test_ztring.c.

void test_strrtrim ( )

test->strrtrim()

Definition at line 572 of file test_ztring.c.

void test_strtrim ( )

test->strtrim()

Definition at line 661 of file test_ztring.c.

void test_memczap ( )

Test->memczap()

Definition at line 669 of file test_ztring.c.

void test_strpfx ( )

test->strpfx()

Definition at line 733 of file test_ztring.c.

void test_strsffx ( )

test->strsffx()

Definition at line 744 of file test_ztring.c.

void test_strrspn ( )

test->strrspn()

Definition at line 755 of file test_ztring.c.

void test_strxltn1 ( )

test->strxltn1()

Definition at line 767 of file test_ztring.c.

void test_zsize1 ( )

test -> (size==1) ==> *dest=0 forall( ztr???() )

Definition at line 832 of file test_ztring.c.

void test_subindex ( )

test -> "string"[0] == 's' ???

Definition at line 950 of file test_ztring.c.

int main ( )

Definition at line 977 of file test_ztring.c.