func TestBucketTreeDeltaGetRootWithoutProcessing(t *testing.T) { conf = initConfig(26, 3, fnvHash) bucketTreeDelta := newBucketTreeDelta() bucketKey1 := newBucketKey(2, 1) bucketTreeDelta.getOrCreateBucketNode(bucketKey1) defer testutil.AssertPanic(t, "A panic should have occured. Because, asking for root node without fully prosessing the bucket tree delta") bucketTreeDelta.getRootNode() }
func TestBucketKeyWrongBucketNumberCausePanic_3(t *testing.T) { conf = newConfig(26, 3, fnvHash) defer testutil.AssertPanic(t, "A panic should occur when asking for a level beyond a valid range") newBucketKey(0, 2) }
func TestStateTxWrongCallCausePanic_3(t *testing.T) { _, state := createFreshDBAndConstructState(t) defer testutil.AssertPanic(t, "A panic should occur when Uuid for tx-begin and tx-finish ends") state.TxBegin("txUuid") state.TxFinish("anotherUuid", true) }
func TestStateTxWrongCallCausePanic_2(t *testing.T) { _, state := createFreshDBAndConstructState(t) defer testutil.AssertPanic(t, "A panic should occur when a tx-begin is invoked before tx-finish for on-going tx") state.TxBegin("txUuid") state.TxBegin("anotherUuid") }
func TestStateTxWrongCallCausePanic_1(t *testing.T) { _, state := createFreshDBAndConstructState(t) defer testutil.AssertPanic(t, "A panic should occur when a set state is invoked with out calling a tx-begin") state.Set("chaincodeID1", "key1", []byte("value1")) }
func TestBucketKeyWrongLevelCausePanic(t *testing.T) { conf = initConfig(26, 3, fnvHash) defer testutil.AssertPanic(t, "A panic should occur when asking for a level beyond a valid range") newBucketKey(4, 1) }