Commit 6625b63b authored by Alexandre Julliard's avatar Alexandre Julliard

Get rid of the no longer used regedit test.

parent 73482144
......@@ -18922,8 +18922,6 @@ esac
ac_config_commands="$ac_config_commands include/wine"
ac_config_commands="$ac_config_commands programs/regedit/tests"
MAKE_RULES=Make.rules
......@@ -19747,7 +19745,6 @@ do
"dlls/user/resources" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/user/resources" ;;
"dlls/wineps/data" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/wineps/data" ;;
"include/wine" ) CONFIG_COMMANDS="$CONFIG_COMMANDS include/wine" ;;
"programs/regedit/tests" ) CONFIG_COMMANDS="$CONFIG_COMMANDS programs/regedit/tests" ;;
"include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
......@@ -20548,8 +20545,6 @@ echo "$as_me: creating dlls/user/resources" >&6;} && mkdir "dlls/user/resources"
echo "$as_me: creating dlls/wineps/data" >&6;} && mkdir "dlls/wineps/data") ;;
include/wine ) test -d "include/wine" || ({ echo "$as_me:$LINENO: creating include/wine" >&5
echo "$as_me: creating include/wine" >&6;} && mkdir "include/wine") ;;
programs/regedit/tests ) test -d "programs/regedit/tests" || ({ echo "$as_me:$LINENO: creating programs/regedit/tests" >&5
echo "$as_me: creating programs/regedit/tests" >&6;} && mkdir "programs/regedit/tests") ;;
esac
done
_ACEOF
......
......@@ -1525,7 +1525,6 @@ WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
WINE_CONFIG_EXTRA_DIR(include/wine)
WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
MAKE_RULES=Make.rules
AC_SUBST_FILE(MAKE_RULES)
......
......@@ -31,11 +31,6 @@ RC_BINARIES = \
regedit.ico \
string.ico
PLTESTS = \
tests/regedit.pl
EXTRASUBDIRS = tests
@MAKE_PROG_RULES@
### Dependencies:
REGEDIT4
[HKEY_CURRENT_USER\Test Regedit]
[HKEY_CURRENT_USER\Test Regedit\New Key #1]
@="222Sample default value data, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long,end"
"A- \" Binary Value #1, long name \\ []= long long long long long long long long long long long long end"=hex:30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36
"a1"=""
"New Binary Value #2"=hex:
"New DWORD Value #1"=dword:00000200
"New DWORD Value #2"=dword:000000c9
"New DWORD Value #3"=dword:00000000
"New String Value #1"="One more long string value 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6 end"
"New String Value #2"=""
"v1"="\" \\,=[]"
[HKEY_CURRENT_USER\Test Regedit\New Key #1\New Key #2]
"Empty Value1"=hex(7):00
"Empty Value2"=hex(7):00,00
"Empty Value3"=hex(7):00,00,00
[HKEY_CURRENT_USER\Test Regedit\New Key #1\New Key #2\New Key #3]
[HKEY_CURRENT_USER\Test Regedit\New Key #1\New Key #2\New Key #3\New Key #4]
@=""
[HKEY_CURRENT_USER\Test Regedit\New Key #1\New Key #2\New Key #3\New Key #4\New Key #5]
[HKEY_CURRENT_USER\Test Regedit\New Key #1\New Key #2\New Key #3\New Key #4.1]
[HKEY_CURRENT_USER\Test Regedit\New Key #1\New Key #2\New Key #3\New Key #6]
[HKEY_CURRENT_USER\Test Regedit\New Key #7]
"Presentation Cache"=hex:64,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,60,60,03,00,64,00,00,00,1b,00,00,00,23,00,00,00,43,3a,5c,57,49,4e,44,\
4f,57,53,5c,53,59,53,54,45,4d,5c,44,45,53,4b,2e,43,50,4c,00,44,69,73,70,6c,\
61,79,00,43,68,61,6e,67,65,73,20,64,69,73,70,6c,61,79,20,73,65,74,74,69,6e,\
67,73,2e,00,00,00,00,94,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,ee,00,00,65,00,00,00,1b,00,00,00,2d,00,00,00,43,3a,5c,57,49,4e,44,\
4f,57,53,5c,53,59,53,54,45,4d,5c,49,4e,54,4c,2e,43,50,4c,00,52,65,67,69,6f,\
6e,61,6c,20,53,65,74,74,69,6e,67,73,00,43,68,61,6e,67,65,73,20,68,6f,77,20,\
6e,75,6d,62,65,72,73,2c,20,63,75,72,72,65,6e,63,69,65,73,2c,20,64,61,74,65,\
73,20,61,6e,64,20,74,69,6d,65,73,20,61,72,65,20,64,69,73,70,6c,61,79,65,64,\
2e,00,00,00,00,74,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,6c,06,00,63,00,00,00,1c,00,00,00,27,00,00,00,43,3a,5c,57,49,4e,44,4f,57,\
53,5c,53,59,53,54,45,4d,5c,4d,4d,53,59,53,2e,43,50,4c,00,4d,75,6c,74,69,6d,\
65,64,69,61,00,43,68,61,6e,67,65,73,20,73,65,74,74,69,6e,67,73,20,66,6f,72,\
20,6d,75,6c,74,69,6d,65,64,69,61,20,64,65,76,69,63,65,73,2e,00,6c,00,00,00,\
01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,6c,06,00,64,00,00,00,1c,\
00,00,00,23,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,\
4d,4d,53,59,53,2e,43,50,4c,00,53,6f,75,6e,64,73,00,43,68,61,6e,67,65,73,20,\
73,79,73,74,65,6d,20,61,6e,64,20,70,72,6f,67,72,61,6d,20,73,6f,75,6e,64,73,\
2e,00,00,00,7c,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,40,\
6c,01,00,e8,03,00,00,1c,00,00,00,23,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,\
5c,53,59,53,54,45,4d,5c,4d,4f,44,45,4d,2e,43,50,4c,00,4d,6f,64,65,6d,73,00,\
49,6e,73,74,61,6c,6c,73,20,61,20,6e,65,77,20,6d,6f,64,65,6d,20,61,6e,64,20,\
63,68,61,6e,67,65,73,20,6d,6f,64,65,6d,20,70,72,6f,70,65,72,74,69,65,73,2e,\
00,00,00,74,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,70,38,\
00,00,64,00,00,00,1d,00,00,00,25,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,\
53,59,53,54,45,4d,5c,4e,45,54,43,50,4c,2e,43,50,4c,00,4e,65,74,77,6f,72,6b,\
00,43,6f,6e,66,69,67,75,72,65,73,20,6e,65,74,77,6f,72,6b,20,68,61,72,64,77,\
61,72,65,20,61,6e,64,20,73,6f,66,74,77,61,72,65,2e,00,00,7c,00,00,00,01,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,b8,00,00,e8,03,00,00,1f,00,00,\
00,29,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,50,41,\
53,53,57,4f,52,44,2e,43,50,4c,00,50,61,73,73,77,6f,72,64,73,00,43,68,61,6e,\
67,65,73,20,70,61,73,73,77,6f,72,64,73,20,61,6e,64,20,73,65,74,73,20,73,65,\
63,75,72,69,74,79,20,6f,70,74,69,6f,6e,73,2e,00,00,00,78,00,00,00,01,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,10,cb,00,00,ca,00,00,00,1f,00,00,00,\
30,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,50,4f,57,\
45,52,43,46,47,2e,43,50,4c,00,50,6f,77,65,72,20,4d,61,6e,61,67,65,6d,65,6e,\
74,00,43,68,61,6e,67,65,73,20,50,6f,77,65,72,20,4d,61,6e,61,67,65,6d,65,6e,\
74,20,73,65,74,74,69,6e,67,73,2e,00,00,88,00,00,00,01,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,02,01,00,6e,00,00,00,1d,00,00,00,33,00,00,00,43,\
3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,41,43,43,45,53,53,2e,43,\
50,4c,00,41,63,63,65,73,73,69,62,69,6c,69,74,79,20,4f,70,74,69,6f,6e,73,00,\
43,68,61,6e,67,65,73,20,61,63,63,65,73,73,69,62,69,6c,69,74,79,20,6f,70,74,\
69,6f,6e,73,20,66,6f,72,20,79,6f,75,72,20,73,79,73,74,65,6d,2e,00,00,00,80,\
00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,1a,01,00,dc,05,\
00,00,1d,00,00,00,31,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,\
45,4d,5c,41,50,50,57,49,5a,2e,43,50,4c,00,41,64,64,2f,52,65,6d,6f,76,65,20,\
50,72,6f,67,72,61,6d,73,00,53,65,74,73,20,75,70,20,70,72,6f,67,72,61,6d,73,\
20,61,6e,64,20,63,72,65,61,74,65,73,20,73,68,6f,72,74,63,75,74,73,2e,00,00,\
00,00,84,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,e8,05,\
00,58,02,00,00,1c,00,00,00,23,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,\
59,53,54,45,4d,5c,53,59,53,44,4d,2e,43,50,4c,00,53,79,73,74,65,6d,00,50,72,\
6f,76,69,64,65,73,20,73,79,73,74,65,6d,20,69,6e,66,6f,72,6d,61,74,69,6f,6e,\
20,61,6e,64,20,63,68,61,6e,67,65,73,20,61,64,76,61,6e,63,65,64,20,73,65,74,\
74,69,6e,67,73,2e,00,00,00,74,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,e8,05,00,5a,02,00,00,1c,00,00,00,2d,00,00,00,43,3a,5c,57,49,\
4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,53,59,53,44,4d,2e,43,50,4c,00,41,64,\
64,20,4e,65,77,20,48,61,72,64,77,61,72,65,00,41,64,64,73,20,6e,65,77,20,68,\
61,72,64,77,61,72,65,20,74,6f,20,79,6f,75,72,20,73,79,73,74,65,6d,2e,00,00,\
80,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,3a,00,00,02,\
02,00,00,1f,00,00,00,29,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,\
54,45,4d,5c,54,45,4c,45,50,48,4f,4e,2e,43,50,4c,00,54,65,6c,65,70,68,6f,6e,\
79,00,43,6f,6e,66,69,67,75,72,65,20,54,65,6c,65,70,68,6f,6e,79,20,44,72,69,\
76,65,72,73,20,61,6e,64,20,44,69,61,6c,69,6e,67,20,50,72,6f,70,65,72,74,69,\
65,73,00,7c,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,92,\
00,00,c8,00,00,00,1f,00,00,00,29,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,\
53,59,53,54,45,4d,5c,54,49,4d,45,44,41,54,45,2e,43,50,4c,00,44,61,74,65,2f,\
54,69,6d,65,00,43,68,61,6e,67,65,73,20,64,61,74,65,2c,20,74,69,6d,65,20,61,\
6e,64,20,74,69,6d,65,20,7a,6f,6e,65,20,69,6e,66,6f,72,6d,61,74,69,6f,6e,2e,\
00,00,6c,00,00,00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,3c,00,\
00,65,00,00,00,1d,00,00,00,2c,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,\
59,53,54,45,4d,5c,54,48,45,4d,45,53,2e,43,50,4c,00,44,65,73,6b,74,6f,70,20,\
54,68,65,6d,65,73,00,50,65,72,73,6f,6e,61,6c,69,7a,65,20,79,6f,75,72,20,63,\
6f,6d,70,75,74,65,72,2e,00,00,84,00,00,00,01,00,00,00,00,a6,e0,d9,fb,2e,be,\
01,00,00,00,00,10,e5,00,00,81,00,00,00,3e,00,00,00,43,00,00,00,43,3a,5c,50,\
52,4f,47,52,41,4d,20,46,49,4c,45,53,5c,43,4f,4d,4d,4f,4e,20,46,49,4c,45,53,\
5c,53,59,53,54,45,4d,5c,4d,41,50,49,5c,31,30,33,33,5c,39,35,5c,4d,4c,43,46,\
47,33,32,2e,43,50,4c,00,4d,61,69,6c,00,4d,69,63,72,6f,73,6f,66,74,20,4f,75,\
74,6c,6f,6f,6b,20,50,72,6f,66,69,6c,65,73,00,00,00,90,00,00,00,01,00,00,00,\
00,d8,d7,16,45,13,c1,01,00,00,00,00,10,f5,03,00,87,11,00,00,1e,00,00,00,2f,\
00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,49,4e,45,54,\
43,50,4c,2e,43,50,4c,00,49,6e,74,65,72,6e,65,74,20,4f,70,74,69,6f,6e,73,00,\
43,6f,6e,66,69,67,75,72,65,73,20,79,6f,75,72,20,49,6e,74,65,72,6e,65,74,20,\
64,69,73,70,6c,61,79,20,61,6e,64,20,63,6f,6e,6e,65,63,74,69,6f,6e,73,20,73,\
65,74,74,69,6e,67,73,00,00,00,00,80,00,00,00,01,00,00,00,00,d8,d7,16,45,13,\
c1,01,00,00,00,00,10,f5,03,00,2b,05,00,00,1e,00,00,00,24,00,00,00,43,3a,5c,\
57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,49,4e,45,54,43,50,4c,2e,43,50,\
4c,00,55,73,65,72,73,00,53,65,74,73,20,75,70,20,61,6e,64,20,6d,61,6e,61,67,\
65,73,20,6d,75,6c,74,69,70,6c,65,20,75,73,65,72,73,20,6f,6e,20,79,6f,75,72,\
20,63,6f,6d,70,75,74,65,72,2e,00,00,00,00,8c,00,00,00,01,00,00,00,20,f8,0b,\
8e,8d,52,c1,01,00,00,00,00,10,a1,00,00,9f,05,00,00,1f,00,00,00,39,00,00,00,\
43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,4f,44,42,43,43,50,33,\
32,2e,43,50,4c,00,4f,44,42,43,20,44,61,74,61,20,53,6f,75,72,63,65,73,20,28,\
33,32,62,69,74,29,00,4d,61,69,6e,74,61,69,6e,73,20,33,32,20,62,69,74,20,4f,\
44,42,43,20,64,61,74,61,20,73,6f,75,72,63,65,73,20,61,6e,64,20,64,72,69,76,\
65,72,73,00,88,00,00,00,01,00,00,00,20,8a,56,a1,02,52,c1,01,00,00,00,00,00,\
60,02,00,66,00,00,00,1a,00,00,00,29,00,00,00,43,3a,5c,57,49,4e,44,4f,57,53,\
5c,53,59,53,54,45,4d,5c,4a,4f,59,2e,43,50,4c,00,47,61,6d,69,6e,67,20,4f,70,\
74,69,6f,6e,73,00,41,64,64,73,2c,20,72,65,6d,6f,76,65,73,2c,20,6f,72,20,63,\
68,61,6e,67,65,73,20,73,65,74,74,69,6e,67,73,20,66,6f,72,20,67,61,6d,65,20,\
63,6f,6e,74,72,6f,6c,6c,65,72,73,00,00,00,00,78,00,00,00,01,00,00,00,00,28,\
35,fe,25,55,be,01,00,00,00,00,00,a0,00,00,66,00,00,00,1f,00,00,00,29,00,00,\
00,43,3a,5c,57,49,4e,44,4f,57,53,5c,53,59,53,54,45,4d,5c,46,49,4e,44,46,41,\
53,54,2e,43,50,4c,00,46,69,6e,64,20,46,61,73,74,00,4d,69,63,72,6f,73,6f,66,\
74,20,46,69,6e,64,20,46,61,73,74,20,28,74,6d,29,20,63,6f,6e,74,65,6e,74,20,\
69,6e,64,65,78,65,72,00,00,00
#!/usr/bin/perl -w
#
# This script tests regedit functionality
#
# Copyright 2002 Andriy Palamarchuk
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
use strict;
use diagnostics;
use winetest;
$main::orig_reg = './tests/orig.reg';
test_regedit();
# Imitation of test framework "ok".
# Uncomment when running on Windows without testing framework
# sub ok($;$)
# {
# my ($condition, $message) = @_;
# if (!$condition)
# {
# die $message;
# }
# }
# Checks if the files are equal regardless of the end-of-line encoding.
# Returns 0 if the files are different, otherwise returns 1
# params - list of file names
sub files_are_equal
{
my @file_names = @_;
my @files = ();
die "At least 2 file names expected" unless ($#file_names);
#compare file contents
foreach my $file_name (@file_names)
{
my $file;
open($file, "<$file_name") || die "Error! can't open file $file_name";
push(@files, $file);
}
my $first_file = shift(@files);
my $line1;
my $line2;
while ($line1 = <$first_file>)
{
$line1 =~ s/\r//;
chomp($line1);
foreach my $file (@files)
{
$line2 = <$file>;
$line2 =~ s/\r//;
chomp($line2);
return 0 if $line1 ne $line2;
}
}
return 1;
}
#removes all test output files
sub clear_output
{
unlink "${main::orig_reg}.exported";
unlink "${main::orig_reg}.exported2";
}
#tests compatibility with regedit
sub test_regedit
{
my $error_no_file_name = "regedit: No file name is specified";
my $error_undefined_switch = "regedit: Undefined switch /";
my $error_no_registry_key = "regedit: No registry key is specified";
my $error_file_not_found = 'regedit: Can\'t open file "dummy_file_name"';
my $error_bad_reg_class_name = 'regedit: Incorrect registry class specification in';
my $error_dont_delete_class = 'regedit: Can\'t delete registry class';
my $test_reg_key = 'HKEY_CURRENT_USER\Test Regedit';
my $s;
my $regedit = -e "./regedit.exe" ? ".\\regedit.exe" : "./regedit";
#no parameters
my $command = "$regedit 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
ok($s =~ /$error_no_file_name/,
'Should raise an error on missed file name');
#ignored parameters
$command = "$regedit /S /V /R:1.reg /L:ss_ss.reg 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
ok($s =~ /$error_no_file_name/,
'Should raise an error on missed file name');
#incorrect form for /L, /R parameters
for my $switch ('L', 'R')
{
$command = "$regedit /$switch 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
ok($s =~ /$error_undefined_switch/, "Incorrect switch format check");
#with ':'
$command = "$regedit /$switch: 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
ok($s =~ /$error_no_file_name/, "Incorrect switch format check");
}
#file does not exist
$command = "$regedit dummy_file_name 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
ok($s =~ /$error_file_not_found/, 'Incorrect processing of not-existing file');
#incorrect registry class is specified
$command = "$regedit /e ${main::orig_reg}.exported \"BAD_CLASS_HKEY\" 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
ok($s =~ /$error_bad_reg_class_name/, 'Incorrect processing of not-existing file');
#import registry file, export registry file, compare the files
$command = "$regedit ${main::orig_reg} 2>&1";
$s = qx/$command/;
ok(!$?, "regedit.exe return code check");
$command = "$regedit /e ${main::orig_reg}.exported \"$test_reg_key\" 2>&1";
$s = qx/$command/;
ok(!$?, "regedit.exe return code check");
ok(files_are_equal("${main::orig_reg}.exported", $main::orig_reg),
"Original and generated registry files " .
"(${main::orig_reg}.exported and ${main::orig_reg}) " .
"are different");
clear_output();
#export bare registry class (2 formats of command line parameter)
#XXX works fine under wine, but commented out because does not handle all key types
#existing on Windows and Windows registry is *very* big
# $command = "$regedit /e ${main::orig_reg}.exported HKEY_CURRENT_USER 2>&1";
# $s = qx/$command/;
# print("DEBUG\t result: $s, return code - $?\n");
# ok(!$?, "regedit.exe return code check");
# $command = "$regedit /e ${main::orig_reg}.exported2 HKEY_CURRENT_USER 2>&1";
# qx/$command/;
# ok(!$?, "regedit.exe return code check");
# ok(files_are_equal("${main::orig_reg}.exported", "${main::orig_reg}.exported2"),
# "Original and generated registry files " .
# "(${main::orig_reg}.exported and ${main::orig_reg}.exported2) " .
# "are different");
##test removal
#incorrect format
$command = "$regedit /d 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
ok($s =~ /$error_no_registry_key/,
'No registry key name is specified for removal');
#try to delete class
$command = "$regedit /d HKEY_CURRENT_USER 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
ok($s =~ /$error_dont_delete_class/, 'Try to remove registry class');
#try to delete registry key with incorrect name
$command = "$regedit /d BAD_HKEY 2>&1";
$s = qx/$command/;
ok($?, "regedit.exe return code check");
#should not export anything after removal because the key does not exist
clear_output();
ok(!-e("${main::orig_reg}.exported"), "Be sure the file is deleted");
$command = "$regedit /d \"$test_reg_key\" 2>&1";
$s = qx/$command/;
$command = "$regedit /e ${main::orig_reg}.exported \"$test_reg_key\" 2>&1";
$s = qx/$command/;
ok(!-e("${main::orig_reg}.exported"),
"File ${main::orig_reg}.exported should not exist");
ok($?, "regedit.exe return code check");
clear_output();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment