Exemple #1
0
func (s *ManagerSuite) SetUpTest(c *C) {
	diskSize := int(4096 * BucketSize)
	s.disk = disk.NewMockDisk(diskSize)
	err := Create("/test-bucket", uint64(diskSize))
	c.Assert(err, IsNil)

	s.m, err = Open("/test-bucket", s.disk)
	c.Assert(err, IsNil)
}
Exemple #2
0
func (s *CacheSuite) SetUpTest(c *C) {
	diskSize := int(4096 * bucket.BucketSize)
	disk := disk.NewMockDisk(diskSize)
	err := bucket.Create("/test-cache-bucket", uint64(diskSize))
	c.Assert(err, IsNil)

	s.buckets, err = bucket.Open("/test-cache-bucket", disk)
	c.Assert(err, IsNil)

	err = hashtable.Create("/test-cache-ht", 2048)
	c.Assert(err, IsNil)

	s.ht, err = hashtable.Open("/test-cache-ht")
	c.Assert(err, IsNil)

	s.cache = New(s.ht, s.buckets)
}