@@ -532,7 +532,6 @@ _test_write (bool at_boundary)
532
532
mongoc_iovec_t riov ;
533
533
ssize_t len = sizeof buf + sizeof buf2 - 2 ;
534
534
535
- #ifndef _MSC_VER
536
535
iov [0 ].iov_base = buf ;
537
536
iov [0 ].iov_len = sizeof (buf ) - 1 ;
538
537
iov [1 ].iov_base = buf2 ;
@@ -592,20 +591,13 @@ _test_write (bool at_boundary)
592
591
assert (mongoc_gridfs_file_seek (file , 0 , SEEK_SET ) == 0 );
593
592
assert (mongoc_gridfs_file_tell (file ) == 0 );
594
593
595
- /* necessary on MSVC, possibly because memcmp compares more bytes than the
596
- * provided length argument:
597
- * randomascii.wordpress.com/2012/10/31/comparing-memory-is-still-tricky
598
- */
599
- memset (buf3 , 0 , sizeof (buf3 ));
600
- memset (expected , 0 , sizeof (expected ));
601
-
602
594
r = mongoc_gridfs_file_readv (file , & riov , 1 , 2 * len + seek_len , 0 );
603
595
assert (r == 2 * len + seek_len );
604
596
605
597
/* expect file to be like "fo bazr baz\0\0\0\0\0\0foo bar baz" */
606
- bson_snprintf (expected , sizeof ( expected ) , "fo bazr baz" );
598
+ bson_snprintf (expected , strlen ( "fo bazr baz" ) + 1 , "fo bazr baz" );
607
599
bson_snprintf (expected + strlen ("fo bazr baz" ) + seek_len ,
608
- strlen ("foo bar baz" ) + 1 , "foo bar baz" );
600
+ strlen ("foo bar baz" ) + 1 ,"foo bar baz" );
609
601
610
602
assert (memcmp (buf3 , expected , (size_t ) (2 * len + seek_len )) == 0 );
611
603
assert (mongoc_gridfs_file_save (file ));
@@ -616,7 +608,6 @@ _test_write (bool at_boundary)
616
608
mongoc_gridfs_destroy (gridfs );
617
609
618
610
mongoc_client_destroy (client );
619
- #endif // _MSC_VER
620
611
}
621
612
622
613
0 commit comments