source: branches/3.0/mondo/test/test-mr_stresc.c @ 3116

Last change on this file since 3116 was 3116, checked in by Bruno Cornec, 7 years ago

r5277@localhost: bruno | 2013-05-07 01:22:17 +0200

  • Fix a compiler issue with the new test-mrstresc and also most compiler warnings
  • Property svn:eol-style set to native
File size: 765 bytes
Line 
1/*
2 * $Id$
3 *
4 * Test program for mr_stresc
5 * Can be used on host system with valgrind easier than with mondorestore
6 */
7#include <stdio.h>
8#include <stdlib.h>
9#include "mr_str.h"
10
11void (*mr_cleanup)(void) = NULL;
12
13char **strl = {
14        "test with space",
15        "test with \ backslash",
16        "test with \" doublequote",
17        "test with ' simplequote",
18        "test with ~ tilde",
19        "test with ? questionmark",
20        "test with ! exclammark",
21        "test with & ampersand",
22        "test with * star",
23        "test with | pipe",
24};
25// Number of strings
26const int MAX = 10;
27
28int main() {
29
30        char *p;
31        int i;
32
33        for (i = 1; i <= MAX ; i++) {
34                p = mr_stresc(strl[i], "`$\\\"(){}'[]&*?|!#~", '\\');
35                printf("Original chain is %s\n",strl[i]);
36                printf("Transformed chain is %s\n",p);
37        }
38exit(0);
39}
Note: See TracBrowser for help on using the repository browser.