@@ -92,14 +92,15 @@ func loadInitialFiles(t *testing.T, data dataSection) int32 {
92
92
testhelpers .RequireNil (t , err , "error converting raw message to bytes: %s" , err )
93
93
doc := bsonx.Doc {}
94
94
err = bson .UnmarshalExtJSON (docBytes , false , & doc )
95
- //fmt.Println(doc.LookupElement("_id"))
96
95
testhelpers .RequireNil (t , err , "error creating file document: %s" , err )
97
96
98
- // convert n from int64 to int32
97
+ // convert length from int32 to int64
98
+ if length , err := doc .LookupErr ("length" ); err == nil {
99
+ doc = doc .Delete ("length" )
100
+ doc = doc .Append ("length" , bsonx .Int64 (int64 (length .Int32 ())))
101
+ }
99
102
if cs , err := doc .LookupErr ("chunkSize" ); err == nil {
100
- doc = doc .Delete ("chunkSize" )
101
103
chunkSize = cs .Int32 ()
102
- doc = append (doc , bsonx.Elem {"chunkSize" , bsonx .Int32 (chunkSize )})
103
104
}
104
105
105
106
filesDocs = append (filesDocs , doc )
@@ -129,7 +130,6 @@ func loadInitialFiles(t *testing.T, data dataSection) int32 {
129
130
}
130
131
131
132
if len (filesDocs ) > 0 {
132
- //fmt.Println(filesDocs)
133
133
_ , err := files .InsertMany (ctx , filesDocs )
134
134
testhelpers .RequireNil (t , err , "error inserting into files: %s" , err )
135
135
_ , err = expectedFiles .InsertMany (ctx , filesDocs )
@@ -208,7 +208,7 @@ func runGridFSTestFile(t *testing.T, filepath string, db *mongo.Database) {
208
208
runUploadFromStreamTest (t , test , bucket )
209
209
case "download" :
210
210
runDownloadTest (t , test , bucket )
211
- // runDownloadToStreamTest(t, test, bucket)
211
+ runDownloadToStreamTest (t , test , bucket )
212
212
case "download_by_name" :
213
213
runDownloadByNameTest (t , test , bucket )
214
214
runDownloadByNameToStreamTest (t , test , bucket )
0 commit comments