| 892 | //------------------------------------------------------ |
| 893 | |
| 894 | void |
| 895 | testModifiers() |
| 896 | { |
| 897 | DECLARE_INIT_LISTS; |
| 898 | |
| 899 | // clear |
| 900 | { |
| 901 | // empty |
| 902 | { |
| 903 | object o; |
| 904 | o.clear(); |
| 905 | BOOST_TEST(o.empty()); |
| 906 | } |
| 907 | |
| 908 | // small |
| 909 | { |
| 910 | object o(i0_); |
| 911 | BOOST_TEST(! o.empty()); |
| 912 | o.clear(); |
| 913 | BOOST_TEST(o.empty()); |
| 914 | } |
| 915 | |
| 916 | // large |
| 917 | { |
| 918 | object o(i1_); |
| 919 | BOOST_TEST(! o.empty()); |
| 920 | o.clear(); |
| 921 | BOOST_TEST(o.empty()); |
| 922 | } |
| 923 | } |
| 924 | |
| 925 | // insert(P&&) |
| 926 | { |
| 927 | fail_loop([&](storage_ptr const& sp) |
| 928 | { |
| 929 | object o(sp); |
| 930 | auto result = o.insert( |
| 931 | std::make_pair("x", 1)); |
| 932 | BOOST_TEST(result.second); |
| 933 | BOOST_TEST(result.first->key() == "x"); |
| 934 | BOOST_TEST(result.first->value().as_int64() == 1); |
| 935 | }); |
| 936 | |
| 937 | fail_loop([&](storage_ptr const& sp) |
| 938 | { |
| 939 | object o(sp); |
| 940 | auto const p = std::make_pair("x", 1); |
| 941 | auto result = o.insert(p); |
| 942 | BOOST_TEST(result.second); |
| 943 | BOOST_TEST(result.first->key() == "x"); |
| 944 | BOOST_TEST(result.first->value().as_int64() == 1); |
| 945 | }); |
| 946 | |
| 947 | fail_loop([&](storage_ptr const& sp) |
| 948 | { |
| 949 | object o({ |
| 950 | {"a", 1}, |
| 951 | {"b", 2}, |
nothing calls this directly
no test coverage detected