| 6 | #include <cassert> |
| 7 | |
| 8 | void propagtion() |
| 9 | { |
| 10 | char buffer[1024]; |
| 11 | std::pmr::monotonic_buffer_resource pool{ std::data(buffer), std::size(buffer) }; |
| 12 | std::pmr::polymorphic_allocator<char> alloc(&pool); |
| 13 | |
| 14 | std::string key = "key too long for short string"; |
| 15 | std::string value = "string too long for short string"; |
| 16 | |
| 17 | jsoncons::pmr::json j{ jsoncons::json_object_arg, alloc }; |
| 18 | assert(j.get_allocator().resource() == &pool); |
| 19 | |
| 20 | j.try_emplace(key, value); |
| 21 | |
| 22 | auto it = std::search(std::begin(buffer), std::end(buffer), key.begin(), key.end()); |
| 23 | assert(it != std::end(buffer)); |
| 24 | it = std::search(std::begin(buffer), std::end(buffer), value.begin(), value.end()); |
| 25 | assert(it != std::end(buffer)); |
| 26 | } |
| 27 | |
| 28 | void copy_construction() |
| 29 | { |
no test coverage detected