MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / modifyFields

Method modifyFields

test/simpledb/TupleTest.java:17–32  ·  view source on GitHub ↗

Unit test for Tuple.getField() and Tuple.setField()

()

Source from the content-addressed store, hash-verified

15 * Unit test for Tuple.getField() and Tuple.setField()
16 */
17 @Test public void modifyFields() {
18 TupleDesc td = Utility.getTupleDesc(2);
19
20 Tuple tup = new Tuple(td);
21 tup.setField(0, new IntField(-1));
22 tup.setField(1, new IntField(0));
23
24 assertEquals(new IntField(-1), tup.getField(0));
25 assertEquals(new IntField(0), tup.getField(1));
26
27 tup.setField(0, new IntField(1));
28 tup.setField(1, new IntField(37));
29
30 assertEquals(new IntField(1), tup.getField(0));
31 assertEquals(new IntField(37), tup.getField(1));
32 }
33
34 /**
35 * Unit test for Tuple.getTupleDesc()

Callers

nothing calls this directly

Calls 3

getTupleDescMethod · 0.95
setFieldMethod · 0.95
getFieldMethod · 0.95

Tested by

no test coverage detected