summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2006-07-30 03:22:36 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2006-07-30 03:22:36 +0000
commit805cc8cf030fc2ebe36c1b9e051dec156e2241b2 (patch)
tree2ad770ce04ea4fb18a1572996c1c37bd2d0f6fd5 /test
parent3029cbdcc90eaa683300fce9385a5e6491fd18a9 (diff)
downloadjackcess-805cc8cf030fc2ebe36c1b9e051dec156e2241b2.tar.gz
jackcess-805cc8cf030fc2ebe36c1b9e051dec156e2241b2.zip
handle more tables with more idnex slots than actual indexes (fix bug 1530312)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@78 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'test')
-rw-r--r--test/data/indexTest.mdbbin0 -> 196608 bytes
-rw-r--r--test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java17
2 files changed, 17 insertions, 0 deletions
diff --git a/test/data/indexTest.mdb b/test/data/indexTest.mdb
new file mode 100644
index 0000000..7e8bd98
--- /dev/null
+++ b/test/data/indexTest.mdb
Binary files differ
diff --git a/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java b/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
index f22edcb..084fa65 100644
--- a/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
+++ b/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java
@@ -423,6 +423,23 @@ public class DatabaseTest extends TestCase {
}
}
+ public void testIndexSlots() throws Exception
+ {
+ Database mdb = Database.open(new File("test/data/indexTest.mdb"));
+
+ Table table = mdb.getTable("Table1");
+ assertEquals(4, table.getIndexes().size());
+ assertEquals(4, table.getIndexSlotCount());
+
+ table = mdb.getTable("Table2");
+ assertEquals(2, table.getIndexes().size());
+ assertEquals(3, table.getIndexSlotCount());
+
+ table = mdb.getTable("Table3");
+ assertEquals(2, table.getIndexes().size());
+ assertEquals(3, table.getIndexSlotCount());
+ }
+
private Object[] createTestRow() {
return new Object[] {"Tim", "R", "McCune", 1234, (byte) 0xad, 555.66d,
777.88f, (short) 999, new Date()};