diff options
author | Riccardo Spagni <ric@spagni.net> | 2014-09-25 08:24:42 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-09-25 08:24:42 +0200 |
commit | 59a8366bb18653f14142321a9d85377ceaef8fad (patch) | |
tree | bad5d2d8ce4e7fa651b7e03a4e749a823032a0f2 /tests/unit_tests | |
parent | Merge pull request #160 from tewinget/remove_ldns_dep (diff) | |
download | monero-59a8366bb18653f14142321a9d85377ceaef8fad.tar.xz |
Revert "low risk, potentially varint overflow bug patched thanks to BBR"
This reverts commit 4e2b2b942daa4206ec44c66e59863670dfe3fde4.
Diffstat (limited to 'tests/unit_tests')
-rw-r--r-- | tests/unit_tests/serialization.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp index 3ae5bcdf6..4a254b5a4 100644 --- a/tests/unit_tests/serialization.cpp +++ b/tests/unit_tests/serialization.cpp @@ -299,37 +299,6 @@ namespace } } -bool test_get_varint_packed_size_for_num(uint64_t n) -{ -std::stringstream ss; -typedef std::ostreambuf_iterator<char> it; -tools::write_varint(it(ss), n); -uint64_t sz = ss.str().size(); -if(sz != tools::get_varint_packed_size(n)) -return false; -else -return true; -} -TEST(Serialization, validate_get_varint_packed_size) -{ -ASSERT_TRUE(test_get_varint_packed_size_for_num(127)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(128)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(16383)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(16383+1)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(2097151)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(2097151+1)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(268435455)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(268435455+1)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(34359738367)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(34359738367+1)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(4398046511103)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(4398046511103+1)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(4398046511103)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(4398046511103+1)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(562949953421311)); -ASSERT_TRUE(test_get_varint_packed_size_for_num(562949953421311+1)); -} - TEST(Serialization, serializes_transacion_signatures_correctly) { using namespace cryptonote; |