@@ -32,20 +32,23 @@ func (s *ObjectSuite) SetUpTest(c *C) {
32
32
33
33
func (s * ObjectSuite ) TestAdd_SameObject (c * C ) {
34
34
s .c .Add (s .aObject )
35
- c .Assert (s .c .actualSize , Equals , int64 ( 1 * Byte ) )
35
+ c .Assert (s .c .actualSize , Equals , 1 * Byte )
36
36
s .c .Add (s .aObject )
37
- c .Assert (s .c .actualSize , Equals , int64 ( 1 * Byte ) )
37
+ c .Assert (s .c .actualSize , Equals , 1 * Byte )
38
38
}
39
39
40
40
func (s * ObjectSuite ) TestAdd_BigObject (c * C ) {
41
41
s .c .Add (s .bObject )
42
- c .Assert (s .c .actualSize , Equals , int64 (0 ))
42
+ c .Assert (s .c .actualSize , Equals , 0 * Byte )
43
+ c .Assert (s .c .actualSize , Equals , 0 * KiByte )
44
+ c .Assert (s .c .actualSize , Equals , 0 * MiByte )
45
+ c .Assert (s .c .actualSize , Equals , 0 * GiByte )
43
46
c .Assert (len (s .c .objects ), Equals , 0 )
44
47
}
45
48
46
49
func (s * ObjectSuite ) TestAdd_CacheOverflow (c * C ) {
47
50
s .c .Add (s .aObject )
48
- c .Assert (s .c .actualSize , Equals , int64 ( 1 * Byte ) )
51
+ c .Assert (s .c .actualSize , Equals , 1 * Byte )
49
52
s .c .Add (s .cObject )
50
53
c .Assert (len (s .c .objects ), Equals , 2 )
51
54
s .c .Add (s .dObject )
@@ -58,18 +61,18 @@ func (s *ObjectSuite) TestAdd_CacheOverflow(c *C) {
58
61
59
62
func (s * ObjectSuite ) TestClear (c * C ) {
60
63
s .c .Add (s .aObject )
61
- c .Assert (s .c .actualSize , Equals , int64 ( 1 * Byte ) )
64
+ c .Assert (s .c .actualSize , Equals , 1 * Byte )
62
65
s .c .Clear ()
63
- c .Assert (s .c .actualSize , Equals , int64 ( 0 ) )
66
+ c .Assert (s .c .actualSize , Equals , 0 * Byte )
64
67
c .Assert (s .c .Get (s .aObject .Hash ()), IsNil )
65
68
}
66
69
67
70
type dummyObject struct {
68
71
hash plumbing.Hash
69
- size int64
72
+ size FileSize
70
73
}
71
74
72
- func newObject (hash string , size int64 ) plumbing.EncodedObject {
75
+ func newObject (hash string , size FileSize ) plumbing.EncodedObject {
73
76
return & dummyObject {
74
77
hash : plumbing .NewHash (hash ),
75
78
size : size ,
@@ -79,7 +82,7 @@ func newObject(hash string, size int64) plumbing.EncodedObject {
79
82
func (d * dummyObject ) Hash () plumbing.Hash { return d .hash }
80
83
func (* dummyObject ) Type () plumbing.ObjectType { return plumbing .InvalidObject }
81
84
func (* dummyObject ) SetType (plumbing.ObjectType ) {}
82
- func (d * dummyObject ) Size () int64 { return d .size }
85
+ func (d * dummyObject ) Size () int64 { return int64 ( d .size ) }
83
86
func (* dummyObject ) SetSize (s int64 ) {}
84
87
func (* dummyObject ) Reader () (io.ReadCloser , error ) { return nil , nil }
85
88
func (* dummyObject ) Writer () (io.WriteCloser , error ) { return nil , nil }
0 commit comments