aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/intpool_test.go
diff options
context:
space:
mode:
authorjm <jm.huang@cobinhood.com>2019-01-15 00:48:13 +0800
committerJhih-Ming Huang <jm.huang@cobinhood.com>2019-05-06 10:44:03 +0800
commit266068a53cdf9e06acacf982d63653c03133a634 (patch)
treeaf2d74e6adb309adfe39bafaa2f540fe0bcd1a31 /core/vm/intpool_test.go
parentd41cb421d755b8f0bca87b7476f26aa4b879b9d9 (diff)
downloaddexon-266068a53cdf9e06acacf982d63653c03133a634.tar
dexon-266068a53cdf9e06acacf982d63653c03133a634.tar.gz
dexon-266068a53cdf9e06acacf982d63653c03133a634.tar.bz2
dexon-266068a53cdf9e06acacf982d63653c03133a634.tar.lz
dexon-266068a53cdf9e06acacf982d63653c03133a634.tar.xz
dexon-266068a53cdf9e06acacf982d63653c03133a634.tar.zst
dexon-266068a53cdf9e06acacf982d63653c03133a634.zip
core: vm: refactor file structure
For support other vm types, this pr modified the core/vm file structures.
Diffstat (limited to 'core/vm/intpool_test.go')
-rw-r--r--core/vm/intpool_test.go26
1 files changed, 13 insertions, 13 deletions
diff --git a/core/vm/intpool_test.go b/core/vm/intpool_test.go
index 6c0d00f3c..120d9a682 100644
--- a/core/vm/intpool_test.go
+++ b/core/vm/intpool_test.go
@@ -21,35 +21,35 @@ import (
)
func TestIntPoolPoolGet(t *testing.T) {
- poolOfIntPools.pools = make([]*intPool, 0, poolDefaultCap)
+ PoolOfIntPools.Pools = make([]*IntPool, 0, PoolDefaultCap)
- nip := poolOfIntPools.get()
+ nip := PoolOfIntPools.Get()
if nip == nil {
t.Fatalf("Invalid pool allocation")
}
}
func TestIntPoolPoolPut(t *testing.T) {
- poolOfIntPools.pools = make([]*intPool, 0, poolDefaultCap)
+ PoolOfIntPools.Pools = make([]*IntPool, 0, PoolDefaultCap)
- nip := poolOfIntPools.get()
- if len(poolOfIntPools.pools) != 0 {
+ nip := PoolOfIntPools.Get()
+ if len(PoolOfIntPools.Pools) != 0 {
t.Fatalf("Pool got added to list when none should have been")
}
- poolOfIntPools.put(nip)
- if len(poolOfIntPools.pools) == 0 {
+ PoolOfIntPools.Put(nip)
+ if len(PoolOfIntPools.Pools) == 0 {
t.Fatalf("Pool did not get added to list when one should have been")
}
}
func TestIntPoolPoolReUse(t *testing.T) {
- poolOfIntPools.pools = make([]*intPool, 0, poolDefaultCap)
- nip := poolOfIntPools.get()
- poolOfIntPools.put(nip)
- poolOfIntPools.get()
+ PoolOfIntPools.Pools = make([]*IntPool, 0, PoolDefaultCap)
+ nip := PoolOfIntPools.Get()
+ PoolOfIntPools.Put(nip)
+ PoolOfIntPools.Get()
- if len(poolOfIntPools.pools) != 0 {
- t.Fatalf("Invalid number of pools. Got %d, expected %d", len(poolOfIntPools.pools), 0)
+ if len(PoolOfIntPools.Pools) != 0 {
+ t.Fatalf("Invalid number of pools. Got %d, expected %d", len(PoolOfIntPools.Pools), 0)
}
}