Last change
on this file since 3124 was 3116, checked in by Bruno Cornec, 11 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
|
Rev | Line | |
---|
[3111] | 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>
|
---|
[3116] | 8 | #include <stdlib.h>
|
---|
[3111] | 9 | #include "mr_str.h"
|
---|
| 10 |
|
---|
[3116] | 11 | void (*mr_cleanup)(void) = NULL;
|
---|
| 12 |
|
---|
| 13 | char **strl = {
|
---|
[3111] | 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
|
---|
| 26 | const int MAX = 10;
|
---|
| 27 |
|
---|
[3116] | 28 | int main() {
|
---|
[3111] | 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 | }
|
---|
| 38 | exit(0);
|
---|
| 39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.