From 75b943d69c7f41c2c1cc6f566a3709754b97022b Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Mon, 22 Aug 2016 18:14:46 +0000 Subject: [PATCH] bug 59791: make sure hard-coded int literals work for cell type git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1757237 13f79535-47bb-0310-9956-ffa450edef68 --- src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java index db46687c1..406816958 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestCell.java @@ -1030,6 +1030,7 @@ public abstract class BaseTestCell { // Cell.CELL_TYPE_* -> CellType.* cell.setCellValue(5.0); assertEquals(Cell.CELL_TYPE_NUMERIC, cell.getCellType()); + assertEquals(0, cell.getCellType()); //make sure that hard-coded int literals still work, even though users should be using the named constants assertEquals(CellType.NUMERIC, cell.getCellTypeEnum()); // make sure old way and new way are compatible // make sure switch(int|Enum) still works. Cases must be statically resolvable in Java 6 ("constant expression required") @@ -1038,6 +1039,7 @@ public abstract class BaseTestCell { // expected break; case Cell.CELL_TYPE_STRING: + case Cell.CELL_TYPE_BOOLEAN: case Cell.CELL_TYPE_ERROR: case Cell.CELL_TYPE_FORMULA: case Cell.CELL_TYPE_BLANK: