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_forbidden_names_windows.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 tSLDForbiddenNamesWin()
42 if ( lcase( gPlatGroup ) <> "w95" ) then
43 printlog( "No testing for Unix(like)" )
47 '///<h1>Check forbidden filenames on Windows using File-Save dialog</h1>
49 ' This test tries to save files that contain characters that are not allowed
50 ' in filenames on Windows. This covers the entire ASCII range from 0 to 31.
51 ' Currently the ASCII chars 0, 9, 10, and 13 are excluded because we - for some
52 ' reason - do not intercept them.
55 '///+<li>Open a new document</li>
56 '///+<li>Save the file with a name containing the ASCII chars 0 through 31, excluding 0,9,10,13</li>
57 '///+<li>Confirm the warning</li>
58 '///+<li>Close the document</li>
59 '///+<li>Repeat the test for all applications</li>
62 dim cStrangeName as string
63 dim iCounter as integer
65 dim iDocumentType as integer
68 for iDocumentType = 1 to 6 step 3
71 printlog( "Check if reserved filenames on Windows are handled ok" )
74 printlog( " - names with forbidden ASCII-chars" )
75 for iCounter = 1 to 31
79 case 9 : printlog( " - skipping ASCII 009 (horizontal tab)" )
80 case 10 : printlog( " - skipping ASCII 010 (linefeed)" )
81 case 13 : printlog( " - skipping ASCII 013 (carriage return)" )
83 printlog( CHR$(13) & "Using char at decimal position: " & iCounter )
84 cStrangeName = hNameGen_append( iCounter )
85 brc = hSaveFileExpectFailure( cStrangeName , 0 )
89 printlog( "Test succeeded" )