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 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: filedlg_allowed_names.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:14 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : joerg.skottke@sun.com
36 '* short description : check the internal file dialog ( extended tests )
38 '\******************************************************************************
40 testcase tSaveLoadDelFiles()
42 '///<h1>Check allowed filenames on Windows using the File-Save dialog</h1>
44 ' This test checks filenames that resemble Devices and files that contain
45 ' the allowed ASCII chars between 32 and 255. The latter is tested by five
47 ' The test should work for all applications and on all languages/locales.
49 dim cStrangeName as string
50 dim iCounter ' iterator
51 dim iRandom ' random number. should end up to be a value between 32 and 255
54 dim iCurrentDocType as integer ' increment
56 for iCurrentDocType = 1 to 1
59 printlog( "Current Documenttype: " & hNumericDocType( iCurrentDocType ) )
60 printlog( "Check if filenames that resemble devicenames are treated ok" )
64 '///+<li>Open a new document</li>
65 printlog( "Open a new document" )
67 '///+<li>Save/Load/Delete names that resemble port-names (but are valid names)<br>
68 '///+ Please note that beginning with SRC680m238 we cannot save any file without suffix
69 '///+ anymore, whatever we do, a suffix will be present.</li>
70 brc = hSaveLoadDelSuccess( "COM0" , true )
71 brc = hSaveLoadDelSuccess( "COM10" , true )
72 brc = hSaveLoadDelSuccess( "LPT0" , true )
73 brc = hSaveLoadDelSuccess( "LPT10" , true )
75 '///+<li>Save/Load/Delete files containing permitted ASCII-characters</li>
76 ' This test randomizes through a number of characters, a full test of all
77 ' possible ascii characters would simply take too long.
79 printlog( "Names with allowed ASCII-chars" )
86 iRandom = int( 32 + ( 223 * rnd ) )
88 printlog( " * Using decimal char: " & iRandom )
92 ' Exclude some special characters that cannot work
95 case 32 : printlog( " - skipping ASCII-Char: " & iRandom )
96 case 34 : printlog( " - skipping ASCII-Char: " & iRandom )
97 case 35 : printlog( " - skipping ASCII-Char: " & iRandom )
98 case 42 : printlog( " - skipping ASCII-Char: " & iRandom )
99 case 46 : printlog( " - skipping ASCII-Char: " & iRandom )
100 case 47 : printlog( " - skipping ASCII-Char: " & iRandom )
101 case 58 : printlog( " - skipping ASCII-Char: " & iRandom )
102 case 60 : printlog( " - skipping ASCII-Char: " & iRandom )
103 case 62 : printlog( " - skipping ASCII-Char: " & iRandom )
104 case 63 : printlog( " - skipping ASCII-Char: " & iRandom )
105 case 92 : printlog( " - skipping ASCII-Char: " & iRandom )
106 case 124 : printlog( " - skipping ASCII-Char: " & iRandom )
107 case 126 : printlog( " - skipping ASCII-Char: " & iRandom )
111 cStrangeName = hNameGen_append( iRandom )
112 brc = hSaveLoadDelSuccess( cStrangeName , TRUE )
114 cStrangeName = hNameGen_lead( iRandom )
115 brc = hSaveLoadDelSuccess( cStrangeName , TRUE )
121 '///+<li>close the document</li>
122 brc = hDestroyDocument()