import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
check(Variant.VT_I4, new Long(28), codepage);
check(Variant.VT_FILETIME, new Date(), codepage);
check(Variant.VT_LPSTR, "", codepage);
- check(Variant.VT_LPSTR, "ä", codepage);
- check(Variant.VT_LPSTR, "äö", codepage);
- check(Variant.VT_LPSTR, "äöü", codepage);
- check(Variant.VT_LPSTR, "äöüÄ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖÜ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖÜß", codepage);
+ check(Variant.VT_LPSTR, "\u00e4", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df", codepage);
check(Variant.VT_LPWSTR, "", codepage);
- check(Variant.VT_LPWSTR, "ä", codepage);
- check(Variant.VT_LPWSTR, "äö", codepage);
- check(Variant.VT_LPWSTR, "äöü", codepage);
- check(Variant.VT_LPWSTR, "äöüÄ", codepage);
- check(Variant.VT_LPWSTR, "äöüÄÖ", codepage);
- check(Variant.VT_LPWSTR, "äöüÄÖÜ", codepage);
- check(Variant.VT_LPWSTR, "äöüÄÖÜß", codepage);
+ check(Variant.VT_LPWSTR, "\u00e4", codepage);
+ check(Variant.VT_LPWSTR, "\u00e4\u00f6", codepage);
+ check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc", codepage);
+ check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc\u00c4", codepage);
+ check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6", codepage);
+ check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc", codepage);
+ check(Variant.VT_LPWSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df", codepage);
}
catch (Exception ex)
{
try
{
check(Variant.VT_LPSTR, "", codepage);
- check(Variant.VT_LPSTR, "ä", codepage);
- check(Variant.VT_LPSTR, "äö", codepage);
- check(Variant.VT_LPSTR, "äöü", codepage);
- check(Variant.VT_LPSTR, "äöüÄ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖÜ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖÜß", codepage);
+ check(Variant.VT_LPSTR, "\u00e4", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df", codepage);
if (codepage == 1200 || codepage == 65001)
check(Variant.VT_LPSTR, "\u79D1\u5B78", codepage);
}
try
{
check(Variant.VT_LPSTR, "", codepage);
- check(Variant.VT_LPSTR, "ä", codepage);
- check(Variant.VT_LPSTR, "äö", codepage);
- check(Variant.VT_LPSTR, "äöü", codepage);
- check(Variant.VT_LPSTR, "äöüÄ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖÜ", codepage);
- check(Variant.VT_LPSTR, "äöüÄÖÜß", codepage);
+ check(Variant.VT_LPSTR, "\u00e4", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc", codepage);
+ check(Variant.VT_LPSTR, "\u00e4\u00f6\u00fc\u00c4\u00d6\u00dc\u00df", codepage);
fail("UnsupportedEncodingException for codepage " + codepage +
" expected.");
}
{
final File dataDir =
new File(System.getProperty("HPSF.testdata.path"));
+ String[] filesToTest = new String[]{
+ "Test0313rur.adm",
+ "TestChineseProperties.doc",
+ "TestCorel.shw",
+ "TestEditTime.doc",
+ "TestGermanWord90.doc",
+ "TestMickey.doc",
+ "TestSectionDictionary.doc",
+ "TestUnicode.xls"
+
+ };
+ final java.util.List listFilesToTest = Arrays.asList(filesToTest);
final File[] fileList = dataDir.listFiles(new FileFilter()
{
public boolean accept(final File f)
{
- return f.isFile();
+ return listFilesToTest.contains(f.getName());
}
});
for (int i = 0; i < fileList.length; i++)
/* Compare the property set stream with the corresponding one
* from the origin file and check whether they are equal. */
- assertEquals(ps1, ps2);
+ assertEquals("Equality for file "+f.getName(),ps1, ps2);
}
}
catch (Exception ex)