File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ size_t EstimateColumnStringMemoryUsage(
4747 ? COLUMN_STRING_DEFAULT_BLOCK_SIZE % static_cast <size_t >(static_cast <size_t >(item_estimated_size) * value_to_estimation_average_size_ratio)
4848 : COLUMN_STRING_DEFAULT_BLOCK_SIZE / 10 );
4949
50- const auto max_estimation_error_factor = item_estimated_size == ColumnString::NO_PREALLOCATE ? 2.5 : 2 ;
50+ const auto max_estimation_error_factor = item_estimated_size == ColumnString::NO_PREALLOCATE ? 2 : 1. 2 ;
5151
5252 return (number_of_items * sizeof (std::string_view)
5353 + estimated_total_item_size
Original file line number Diff line number Diff line change @@ -158,15 +158,16 @@ TEST_F(OutputTest, PrettyPrintByteSize)
158158 {3.25 , " 3.25" },
159159 {13.75 , " 13.75" },
160160 {135.5 , " 135.5" },
161- {135.125 , " 135.125 " },
161+ {135.125 , " 135.12 " },
162162 {10 , " 10" },
163163 {100 , " 100" },
164164 {1000 , " 1000" },
165165 })
166166 {
167167 const auto bytes_value = static_cast <size_t >(base * value);
168168 const auto expected_str = std::string (value_str) + " " + base_name;
169- EXPECT_EQ (expected_str, ToString (PrettyPrintByteSize{bytes_value}))
169+
170+ EXPECT_EQ (expected_str, ToString (PrettyPrintByteSize{bytes_value, 2 }))
170171 << " \n\t base: " << base
171172 << " \n\t base_name: " << base_name
172173 << " \n\t value: " << value
You can’t perform that action at this time.
0 commit comments