Running fpspreadsheet on Ubuntu lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- wp · 2013-12-26 19:41 The demo project excel8write.lpi creates a test Excel file "test.xls" containing some test cells. The parameter "OverwriteExisting" in TsWorkbook.WriteToFile determines how existing files are treated when the file is written. If true the demo project silently overwrites an existing file on Windows. On Ubuntu, however, a SIGSEGV occurs with the message "In file 'uvirtuallayer_ole.pas' at line 590: if FDirectory[j]._mse=BYTE(STGTY_INVALID) then begin". When the file is deleted before starting excel8write the program runs fine. In the test suite, TestReadString4 and TestReadString6 fail on Ubuntu: "Test value mismatch cell Texts!A5 expected: but was: " ---------------------------------------------------------------------- BigChimp · 2013-12-27 09:38 Strange. Just wrote & committed a test for the overwrite problem. Ran testsuite on Debian unstable (I think, could be testing), x64. However, did it with FPC trunk/Laz trunk, you're probably using another version? QuoteNumber of run tests: 120 Number of errors:    0 Number of failures:  0 Perhaps locale-related?? Quotelocale LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= Quotefile stringtests.pas stringtests.pas: UTF-8 Unicode text ... as expected ---------------------------------------------------------------------- BigChimp · 2013-12-27 10:17 Just compiled tests FPC 2.6.2+Laz (some revision) on that Debian machine and still all tests succeed... ---------------------------------------------------------------------- wp · 2013-12-27 12:23 QuoteFPC trunk/Laz trunk, you're probably using another versionfpc 2.6.3, Laz trunk (r.43585), x84 QuotePerhaps locale-related??Mine is de_DE.utf8 in all cases. ---------------------------------------------------------------------- BigChimp · 2013-12-27 12:33 Mmm... I wonder if we need to explicitly add lconvencoding, lazutf8 etc to the strings test page and/or cwstring? TBH, I've ignored encoding for a while and haven't looked into what kind of magic is needed to get everything set up in FPC 2.6 as well as trunk. I was just glad the tests worked... The other issue: Does testcase TSpreadInternalTests.OverwriteExistingFile fail for you? ---------------------------------------------------------------------- wp · 2013-12-27 18:33 QuoteDoes testcase TSpreadInternalTests.OverwriteExistingFile fail for you?No, but TSpreadManualTests.TestBiff8CellBackgroundColor() fails in Workbook.WriteToFile (manual xls file, of course, is closed). Debugging deeper, I come into TOLEStorage.WriteOLEFile which crashes in the line Code: [Select]OLEStream:=fsOLE.CreateStream(VLAbsolutePath,fmCreate);  Unfortunately, this OLE thing is beyond my capabilities... Regarding the localization issue, I saw a record "COUNTRY" in the biff description: "This record stores two Windows country identifiers. The first represents the Windows user interface language of the Excel version that saved the file, and the second represents the system regional settingsat the time the file was saved" (section 5.22). As far as I can see see this record is missing in xlsbiff8. ---------------------------------------------------------------------- BigChimp · 2013-12-27 19:16 Quote from: wp on December 27, 2013, 07:33:42 pmQuoteDoes testcase TSpreadInternalTests.OverwriteExistingFile fail for you?No, but TSpreadManualTests.TestBiff8CellBackgroundColor() fails in Workbook.WriteToFile (manual xls file, of course, is closed). Stranger and stranger. The test OverwriteExistingFile  uses biff8 format as well... What's the difference, I'd say!?! Will have a look at the exact code probably tomorrow. Quote from: wp on December 27, 2013, 07:33:42 pmDebugging deeper, I come into TOLEStorage.WriteOLEFile which crashes in the line Code: [Select]OLEStream:=fsOLE.CreateStream(VLAbsolutePath,fmCreate);  Unfortunately, this OLE thing is beyond my capabilities... Certainly beyond mine. Quote from: wp on December 27, 2013, 07:33:42 pmRegarding the localization issue, I saw a record "COUNTRY" in the biff description: "This record stores two Windows country identifiers. The first represents the Windows user interface language of the Excel version that saved the file, and the second represents the system regional settingsat the time the file was saved" (section 5.22). As far as I can see see this record is missing in xlsbiff8. Well, given that the tests don't fail on my Linux machine and we're not yet testing interoperability with Excel, I wonder whether that record would have any effect... Time to expand the test suite to at least Libre/OpenOffice, I'd think... ---------------------------------------------------------------------- BigChimp · 2014-01-08 15:43 Just committed an explicit codepage specification for FPC trunk (has no influence on 2.6.x) for stringtests.pas which may fix the issue - at least on trunk... ---------------------------------------------------------------------- wp · 2014-01-08 23:20 Upgraded my Ubuntu fpc and Laz to current trunk each and ran the test. TestReadString4 and TestReadString6, however, still failing. ---------------------------------------------------------------------- BigChimp · 2014-01-09 09:29 Arggh. Thanks for testing.