diff --git a/include/sparrow/dictionary_encoded_layout.hpp b/include/sparrow/dictionary_encoded_layout.hpp index 1f754427..91db85fe 100644 --- a/include/sparrow/dictionary_encoded_layout.hpp +++ b/include/sparrow/dictionary_encoded_layout.hpp @@ -53,6 +53,9 @@ namespace sparrow using sub_layout = mpl::constify_t; using sub_layout_reference = sub_layout&; + // `dictionary_value_iterator` needs to be default constructible + // to satisfy `dictionary_encoded_layout::const_value_range`'s + // constraints. dictionary_value_iterator() noexcept = default; dictionary_value_iterator(index_iterator index_it, sub_layout_reference sub_layout_reference); @@ -114,7 +117,7 @@ namespace sparrow using const_reference = const_reference_proxy; using size_type = std::size_t; using indexes_layout = fixed_size_layout; - using iterator_tag = std::contiguous_iterator_tag; + using iterator_tag = std::random_access_iterator_tag; /** * These types have to be public to be accessible when @@ -129,6 +132,8 @@ namespace sparrow using data_iterator = data_type*; using const_data_iterator = const data_type*; + // TODO: implement the iterator once #35 is merged + // using iterator = layout_iterator; using const_iterator = layout_iterator; using bitmap_iterator = indexes_layout::bitmap_iterator; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c7b7caca..0a196bf6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -42,6 +42,7 @@ set(SPARROW_TESTS_SOURCES test_layout.cpp test_variable_size_binary_layout.cpp test_dictionary_encoded_layout.cpp + test_memory.cpp ) set(test_target "test_sparrow_lib") add_executable(${test_target} ${SPARROW_TESTS_SOURCES}) diff --git a/test/test_dictionary_encoded_layout.cpp b/test/test_dictionary_encoded_layout.cpp index c420a9d8..f8126300 100644 --- a/test/test_dictionary_encoded_layout.cpp +++ b/test/test_dictionary_encoded_layout.cpp @@ -26,7 +26,7 @@ using data_type_t = uint8_t; constexpr size_t element_count = 10; -static const std::array indexes {1,0,3, 0,1,2,3, 2, 4,2}; +static const std::array indexes {1, 0,3, 0, 1, 2, 3, 2, 4, 2}; namespace sparrow { @@ -92,13 +92,10 @@ namespace sparrow TEST_CASE_FIXTURE(dictionary_encoded_fixture, "constructors") { - CHECK(m_data.dictionary.use_count() == 1); CHECK(m_data.buffers.size() == 1); const layout_type l_copy(m_data); - CHECK(m_data.dictionary.use_count() == 2); CHECK(m_data.buffers.size() == 1); const layout_type l_move(std::move(m_data)); - CHECK(m_data.dictionary.use_count() == 0); CHECK(m_data.buffers.size() == 0); }