コード例 #1
0
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()
}
コード例 #2
0
ファイル: bucket_key_test.go プロジェクト: butine/research
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)
}
コード例 #3
0
ファイル: state_test.go プロジェクト: butine/research
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)
}
コード例 #4
0
ファイル: state_test.go プロジェクト: butine/research
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")
}
コード例 #5
0
ファイル: state_test.go プロジェクト: butine/research
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"))
}
コード例 #6
0
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)
}