aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache
diff options
context:
space:
mode:
authorJaven O'Neal <onealj@apache.org>2015-10-31 11:20:15 +0000
committerJaven O'Neal <onealj@apache.org>2015-10-31 11:20:15 +0000
commit14736096ec04a8a1e0a0d307f4fa389e57f0833d (patch)
treee49e9b337edd7e017ed4ce5835dc714f9dfba133 /src/testcases/org/apache
parentbc358fe708e333b2b35230047b8327a2f5c3ff05 (diff)
downloadpoi-14736096ec04a8a1e0a0d307f4fa389e57f0833d.tar.gz
poi-14736096ec04a8a1e0a0d307f4fa389e57f0833d.zip
improve error message if CellRangeAddress intersection assertion fails
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711597 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache')
-rw-r--r--src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java b/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java
index 5c35a2dff1..cf9e6019e7 100644
--- a/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java
+++ b/src/testcases/org/apache/poi/ss/util/TestCellRangeAddress.java
@@ -256,11 +256,17 @@ public final class TestCellRangeAddress extends TestCase {
}
private static void assertIntersects(CellRangeAddress regionA, CellRangeAddress regionB) {
- assertTrue(regionA.intersects(regionB));
- assertTrue(regionB.intersects(regionA));
+ if (!(regionA.intersects(regionB) && regionB.intersects(regionA))) {
+ final String A = regionA.formatAsString();
+ final String B = regionB.formatAsString();
+ fail("expected: regions "+A+" and "+B+" intersect");
+ }
}
private static void assertNotIntersects(CellRangeAddress regionA, CellRangeAddress regionB) {
- assertFalse(regionA.intersects(regionB));
- assertFalse(regionB.intersects(regionA));
+ if ((regionA.intersects(regionB) || regionB.intersects(regionA))) {
+ final String A = regionA.formatAsString();
+ final String B = regionB.formatAsString();
+ fail("expected: regions "+A+" and "+B+" do not intersect");
+ }
}
}