Changeset View
Changeset View
Standalone View
Standalone View
src/test/rwcollection_tests.cpp
// Copyright (c) 2018 The Bitcoin developers | // Copyright (c) 2018 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <rwcollection.h> | #include <rwcollection.h> | ||||
#include <reverse_iterator.h> | #include <reverse_iterator.h> | ||||
#include <test/test_bitcoin.h> | #include <test/test_bitcoin.h> | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
#include <set> | #include <set> | ||||
#include <vector> | #include <vector> | ||||
BOOST_AUTO_TEST_SUITE(rwcollection_tests); | BOOST_AUTO_TEST_SUITE(rwcollection_tests) | ||||
BOOST_AUTO_TEST_CASE(vector) { | BOOST_AUTO_TEST_CASE(vector) { | ||||
RWCollection<std::vector<int>> rwvector; | RWCollection<std::vector<int>> rwvector; | ||||
{ | { | ||||
auto w = rwvector.getWriteView(); | auto w = rwvector.getWriteView(); | ||||
for (int i = 0; i < 100; i++) { | for (int i = 0; i < 100; i++) { | ||||
w->push_back(i + 10); | w->push_back(i + 10); | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |