Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunrd0 committed Jul 19, 2023
1 parent 6a9a9df commit 71af9fc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
10 changes: 2 additions & 8 deletions tiledb/sm/filter/bit_width_reduction_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ Status BitWidthReductionFilter::run_forward(
auto data_type_size = static_cast<uint8_t>(datatype_size(filter_data_type_));

// If bit width compression can't work, just return the input unmodified.
if ((!datatype_is_integer(filter_data_type_) &&
!datatype_is_time(filter_data_type_) &&
!datatype_is_datetime(filter_data_type_)) ||
data_type_size == 1) {
if (!datatype_is_integer(filter_data_type_) || data_type_size == 1) {
RETURN_NOT_OK(output->append_view(input));
RETURN_NOT_OK(output_metadata->append_view(input_metadata));
return Status::Ok();
Expand Down Expand Up @@ -301,10 +298,7 @@ Status BitWidthReductionFilter::run_reverse(
auto data_type_size = static_cast<uint8_t>(datatype_size(filter_data_type_));

// If bit width compression wasn't applied, just return the input unmodified.
if ((!datatype_is_integer(filter_data_type_) &&
!datatype_is_time(filter_data_type_) &&
!datatype_is_datetime(filter_data_type_)) ||
data_type_size == 1) {
if (!datatype_is_integer(filter_data_type_) || data_type_size == 1) {
RETURN_NOT_OK(output->append_view(input));
RETURN_NOT_OK(output_metadata->append_view(input_metadata));
return Status::Ok();
Expand Down
4 changes: 2 additions & 2 deletions tiledb/sm/filter/filter_create.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ shared_ptr<tiledb::sm::Filter> tiledb::sm::FilterCreate::deserialize(
uint8_t compressor_char = deserializer.read<uint8_t>();
int compression_level = deserializer.read<int32_t>();
Datatype reinterpret_type = Datatype::ANY;
if (filtertype == FilterType::FILTER_DELTA ||
filtertype == FilterType::FILTER_DOUBLE_DELTA) {
if (version >= 19 && (filtertype == FilterType::FILTER_DELTA ||
filtertype == FilterType::FILTER_DOUBLE_DELTA)) {
uint8_t reinterpret = deserializer.read<uint8_t>();
reinterpret_type = static_cast<Datatype>(reinterpret);
}
Expand Down
8 changes: 2 additions & 6 deletions tiledb/sm/filter/positive_delta_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ Status PositiveDeltaFilter::run_forward(
FilterBuffer* output_metadata,
FilterBuffer* output) const {
// If encoding can't work, just return the input unmodified.
if (!datatype_is_integer(filter_data_type_) &&
!datatype_is_time(filter_data_type_) &&
!datatype_is_datetime(filter_data_type_)) {
if (!datatype_is_integer(filter_data_type_)) {
RETURN_NOT_OK(output->append_view(input));
RETURN_NOT_OK(output_metadata->append_view(input_metadata));
return Status::Ok();
Expand Down Expand Up @@ -252,9 +250,7 @@ Status PositiveDeltaFilter::run_reverse(
const Config& config) const {
(void)config;
// If encoding wasn't applied, just return the input unmodified.
if (!datatype_is_integer(filter_data_type_) &&
!datatype_is_time(filter_data_type_) &&
!datatype_is_datetime(filter_data_type_)) {
if (!datatype_is_integer(filter_data_type_)) {
RETURN_NOT_OK(output->append_view(input));
RETURN_NOT_OK(output_metadata->append_view(input_metadata));
return Status::Ok();
Expand Down
3 changes: 1 addition & 2 deletions tiledb/sm/filter/test/compile_webp_filter_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
* THE SOFTWARE.
*/

#include "tiledb/sm/enums/datatype.h"
#include "tiledb/sm/filter/webp_filter.h"

int main() {
tiledb::sm::WebpFilter(tiledb::sm::Datatype::UINT8);
(void)sizeof(tiledb::sm::WebpFilter);
return 0;
}

0 comments on commit 71af9fc

Please sign in to comment.