MCPcopy Create free account
hub / github.com/cruppstahl/upscaledb / testSetComparator2

Method testSetComparator2

java/unittests/DatabaseTest.java:115–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 }
114
115 public void testSetComparator2() {
116 byte[] k = new byte[5];
117 byte[] r = new byte[5];
118 Environment env = new Environment();
119 Database db;
120 MyComparator cmp = new MyComparator();
121 try {
122 env.create("jtest.db");
123 Parameter[] params = new Parameter[1];
124 params[0] = new Parameter();
125 params[0].name = Const.UPS_PARAM_KEY_TYPE;
126 params[0].value = Const.UPS_TYPE_CUSTOM;
127 db = env.createDatabase((short)1, 0, params);
128 db.setComparator(cmp);
129 db.insert(k, r);
130 k[0] = 1;
131 db.insert(k, r);
132 k[0] = 2;
133 db.insert(k, r);
134 db.close();
135 }
136 catch (DatabaseException err) {
137 env.close();
138 fail("Exception " + err);
139 }
140 assertEquals(2, cmp.m_counter);
141 env.close();
142 }
143
144 public void testGetParameters() {
145 byte[] k = new byte[5];

Callers

nothing calls this directly

Calls 6

createMethod · 0.95
createDatabaseMethod · 0.95
setComparatorMethod · 0.95
insertMethod · 0.95
closeMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected