Skip to content

Commit 9c68654

Browse files
committed
Merge pull request #60 from tribal-tec/master
Fix MSVC build
2 parents af22a21 + b2ffc46 commit 9c68654

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

bin/zerobufCxx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,8 @@ def special_member_functions(self):
917917
"}"))
918918
# move ctor
919919
functions.append(Function(None,
920-
"{0}( {0}&& rhs ) noexcept".format(self.name),
920+
"{0}( {0}&& rhs ){1}".format(self.name,\
921+
" throw()" if os.name == "nt" else " noexcept"),
921922
": ::zerobuf::Zerobuf( std::move( rhs ))\n" +
922923
self.get_move_initializer()))
923924
# copy-from-baseclass ctor

tests/constAllocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ BOOST_AUTO_TEST_CASE(construction)
2222
new zerobuf::ConstAllocator( data.data(), data.size( )));
2323
BOOST_CHECK_THROW( mutableBaseAlloc->getData(), std::runtime_error );
2424
BOOST_CHECK_THROW( mutableBaseAlloc->copyBuffer( nullptr, 0 ), std::runtime_error );
25-
BOOST_CHECK_THROW( mutableBaseAlloc->updateAllocation( 1, 2, 3 ), std::runtime_error );
25+
BOOST_CHECK_THROW( mutableBaseAlloc->updateAllocation( 0, false, 0 ), std::runtime_error );
2626
BOOST_CHECK_THROW( mutableBaseAlloc->compact( 42 ), std::runtime_error );
2727
}
2828

tests/doubleString.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ BOOST_AUTO_TEST_CASE(reallocation)
2626
for( size_t i = 0; i < 1000; ++i )
2727
{
2828
size_t len = ::rand() % 20;
29-
doubleString.setKey( std::string( len, len ));
29+
doubleString.setKey( std::string( len, 'a' ));
3030

3131
len = ::rand() % 20;
32-
doubleString.setValue( std::string( len, len ));
32+
doubleString.setValue( std::string( len, 'a' ));
3333
BOOST_CHECK_LE( doubleString.toBinary().size,
3434
36/*header*/ + 19/*biggest hole*/ + 40/*20b strings*/ );
3535
}

0 commit comments

Comments
 (0)