1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 ' Copyright 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : gregor.hartmann@oracle.com
30 '* short description : check the internal file dialog ( extended tests )
32 '\******************************************************************************
34 testcase tSaveLoadDelFiles()
37 ' This test checks filenames that resemble Devices and files that contain
38 ' the allowed ASCII chars between 32 and 255. The latter is tested by five
40 ' The test should work for all applications and on all languages/locales.
42 dim cStrangeName as string
43 dim iCounter ' iterator
44 dim iRandom ' random number. should end up to be a value between 32 and 255
47 dim iCurrentDocType as integer ' increment
49 for iCurrentDocType = 1 to 1
52 printlog( "Current Documenttype: " & hNumericDocType( iCurrentDocType ) )
53 printlog( "Check if filenames that resemble devicenames are treated ok" )
56 printlog( "Open a new document" )
58 brc = hSaveLoadDelSuccess( "COM0" , true )
59 brc = hSaveLoadDelSuccess( "COM10" , true )
60 brc = hSaveLoadDelSuccess( "LPT0" , true )
61 brc = hSaveLoadDelSuccess( "LPT10" , true )
63 ' This test randomizes through a number of characters, a full test of all
64 ' possible ascii characters would simply take too long.
66 printlog( "Names with allowed ASCII-chars" )
73 iRandom = int( 32 + ( 223 * rnd ) )
75 printlog( " * Using decimal char: " & iRandom )
79 ' Exclude some special characters that cannot work
82 case 32 : printlog( " - skipping ASCII-Char: " & iRandom )
83 case 34 : printlog( " - skipping ASCII-Char: " & iRandom )
84 case 35 : printlog( " - skipping ASCII-Char: " & iRandom )
85 case 42 : printlog( " - skipping ASCII-Char: " & iRandom )
86 case 46 : printlog( " - skipping ASCII-Char: " & iRandom )
87 case 47 : printlog( " - skipping ASCII-Char: " & iRandom )
88 case 58 : printlog( " - skipping ASCII-Char: " & iRandom )
89 case 60 : printlog( " - skipping ASCII-Char: " & iRandom )
90 case 62 : printlog( " - skipping ASCII-Char: " & iRandom )
91 case 63 : printlog( " - skipping ASCII-Char: " & iRandom )
92 case 92 : printlog( " - skipping ASCII-Char: " & iRandom )
93 case 124 : printlog( " - skipping ASCII-Char: " & iRandom )
94 case 126 : printlog( " - skipping ASCII-Char: " & iRandom )
98 cStrangeName = hNameGen_append( iRandom )
99 brc = hSaveLoadDelSuccess( cStrangeName , TRUE )
101 cStrangeName = hNameGen_lead( iRandom )
102 brc = hSaveLoadDelSuccess( cStrangeName , TRUE )
108 brc = hDestroyDocument()