1
by brian
clean slate |
1 |
/* Copyright (C) 2000 MySQL AB
|
2 |
||
3 |
This program is free software; you can redistribute it and/or modify
|
|
4 |
it under the terms of the GNU General Public License as published by
|
|
5 |
the Free Software Foundation; version 2 of the License.
|
|
6 |
||
7 |
This program is distributed in the hope that it will be useful,
|
|
8 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
10 |
GNU General Public License for more details.
|
|
11 |
||
12 |
You should have received a copy of the GNU General Public License
|
|
13 |
along with this program; if not, write to the Free Software
|
|
14 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
15 |
||
16 |
#include "mysys_priv.h" |
|
17 |
||
18 |
const char *test_names[]= |
|
19 |
{
|
|
20 |
"/usr/my/include/srclib/myfunc/dbug/test", |
|
21 |
"test", |
|
22 |
"dbug/test", |
|
23 |
"/usr/my/srclib/myfunc/dbug/test", |
|
24 |
"/usr/monty/oldcopy/jazz/setupp.frm", |
|
25 |
"~/monty.tst", |
|
26 |
"~/dbug/monty.tst", |
|
27 |
"./hejsan", |
|
28 |
"./dbug/test", |
|
29 |
"../dbug/test", |
|
30 |
"../myfunc/test", |
|
31 |
"../../monty/rutedit", |
|
32 |
"/usr/monty//usr/monty/rutedit", |
|
33 |
"/usr/./monty/rutedit", |
|
34 |
"/usr/my/../monty/rutedit", |
|
35 |
"/usr/my/~/rutedit", |
|
36 |
"~/../my", |
|
37 |
"~/../my/srclib/myfunc/test", |
|
38 |
"~/../my/srclib/myfunc/./dbug/test", |
|
39 |
"/../usr/my/srclib/dbug", |
|
40 |
"c/../my", |
|
41 |
"/c/../my", |
|
42 |
NullS, |
|
43 |
};
|
|
44 |
||
45 |
int main(int argc __attribute__((unused)), char **argv) |
|
46 |
{
|
|
47 |
const char **pos; |
|
48 |
char buff[FN_REFLEN],buff2[FN_REFLEN]; |
|
49 |
DBUG_ENTER ("main"); |
|
50 |
DBUG_PROCESS (argv[0]); |
|
51 |
MY_INIT(argv[0]); |
|
52 |
||
53 |
if (argv[1] && argv[1][1] == '#') |
|
54 |
DBUG_PUSH(argv[1]+2); |
|
55 |
||
56 |
for (pos=test_names; *pos ; pos++) |
|
57 |
{
|
|
58 |
printf("org : '%s'\n",*pos); |
|
59 |
printf("pack: '%s'\n",fn_format(buff,*pos,"","",8)); |
|
60 |
printf("unpack: '%s'\n",fn_format(buff2,*pos,"","",4)); |
|
61 |
unpack_filename(buff,buff); |
|
62 |
if (strcmp(buff,buff2) != 0) |
|
63 |
{
|
|
64 |
printf("error on cmp: '%s' != '%s'\n",buff,buff2); |
|
65 |
}
|
|
66 |
puts(""); |
|
67 |
}
|
|
68 |
DBUG_RETURN(0); |
|
69 |
}
|