Summary: | [PATCH] DGET function, correct behavior with empty target cell | ||
---|---|---|---|
Product: | POI | Reporter: | Patrick Böker <patrick.boeker> |
Component: | SS Common | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | Keywords: | PatchAvailable |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
dget_empty_target_cell.patch
DGet.xls |
Created attachment 34245 [details]
DGet.xls
Should go to test-data/spreadsheet/DGet.xls
I've just tried applying your patch to trunk, and updating the DGet file. However, one of the unit tests then fails: Testcase: processFunctionRow[strange types as headers - unused error header values] took 0.001 sec FAILED In DGet.xls DGet!B100 {=DGET($G$92:$N$93,"Three",AH92:AI93)} 'strange types as headers - unused error header values'. Actual: ERROR junit.framework.AssertionFailedError: In DGet.xls DGet!B100 {=DGET($G$92:$N$93,"Three",AH92:AI93)} 'strange types as headers - unused error header values'. Actual: ERROR at org.apache.poi.ss.formula.functions.BaseTestFunctionsFromSpreadsheet.processFunctionRow(BaseTestFunctionsFromSpreadsheet.java:166) Any chance you could see what's going wrong and fix? |
Created attachment 34244 [details] dget_empty_target_cell.patch This patch fixes the return value of DGET when the target cell in the database is empty or the empty string (should return #VALUE!, previously returned 0). I added several more tests to the DGet.xls file checking the behavior with different value types in the target cell. Also added another test about the behavior of error values in the database header.