Skip to content

Commit c3b1250

Browse files
committed
Update the tests to adhere to arrow style code
1 parent a7eb42b commit c3b1250

File tree

2 files changed

+1021
-731
lines changed

2 files changed

+1021
-731
lines changed

cpp/src/arrow/util/alp/alp_test.cc

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
118
#include <cmath>
219
#include <cstdint>
320
#include <random>
@@ -39,11 +56,11 @@ class AlpCompressionFloatTest : public ::testing::Test {
3956

4057
// Compress
4158
AlpEncodingPreset preset{}; // Default preset
42-
auto encoded = compressor.compressVector(input.data(), input.size(), preset);
59+
auto encoded = compressor.CompressVector(input.data(), input.size(), preset);
4360

4461
// Decompress
4562
std::vector<float> output(input.size());
46-
compressor.decompressVector(encoded, output.data());
63+
compressor.DecompressVector(encoded, AlpBitPackLayout::kNormal, output.data());
4764

4865
// Verify
4966
ASSERT_EQ(output.size(), input.size());
@@ -78,8 +95,9 @@ TEST_F(AlpCompressionFloatTest, SmallValues) {
7895
}
7996

8097
TEST_F(AlpCompressionFloatTest, MixedValues) {
81-
std::vector<float> input = {100.5f, 200.25f, 300.125f, 400.0625f,
82-
500.03125f, 600.015625f, 700.0078125f, 800.00390625f};
98+
std::vector<float> input = {100.5f, 200.25f, 300.125f, 400.0625f,
99+
500.03125f, 600.015625f, 700.0078125f,
100+
800.00390625f};
83101
TestCompressDecompressFloat(input);
84102
}
85103

@@ -106,11 +124,11 @@ class AlpCompressionDoubleTest : public ::testing::Test {
106124

107125
// Compress
108126
AlpEncodingPreset preset{}; // Default preset
109-
auto encoded = compressor.compressVector(input.data(), input.size(), preset);
127+
auto encoded = compressor.CompressVector(input.data(), input.size(), preset);
110128

111129
// Decompress
112130
std::vector<double> output(input.size());
113-
compressor.decompressVector(encoded, output.data());
131+
compressor.DecompressVector(encoded, AlpBitPackLayout::kNormal, output.data());
114132

115133
// Verify
116134
ASSERT_EQ(output.size(), input.size());
@@ -159,10 +177,10 @@ TEST(AlpIntegrationTest, LargeFloatDataset) {
159177

160178
AlpCompression<float> compressor;
161179
AlpEncodingPreset preset{};
162-
auto encoded = compressor.compressVector(input.data(), input.size(), preset);
180+
auto encoded = compressor.CompressVector(input.data(), input.size(), preset);
163181

164182
std::vector<float> output(input.size());
165-
compressor.decompressVector(encoded, output.data());
183+
compressor.DecompressVector(encoded, AlpBitPackLayout::kNormal, output.data());
166184

167185
for (size_t i = 0; i < input.size(); ++i) {
168186
EXPECT_FLOAT_EQ(output[i], input[i]);
@@ -180,10 +198,10 @@ TEST(AlpIntegrationTest, LargeDoubleDataset) {
180198

181199
AlpCompression<double> compressor;
182200
AlpEncodingPreset preset{};
183-
auto encoded = compressor.compressVector(input.data(), input.size(), preset);
201+
auto encoded = compressor.CompressVector(input.data(), input.size(), preset);
184202

185203
std::vector<double> output(input.size());
186-
compressor.decompressVector(encoded, output.data());
204+
compressor.DecompressVector(encoded, AlpBitPackLayout::kNormal, output.data());
187205

188206
for (size_t i = 0; i < input.size(); ++i) {
189207
EXPECT_DOUBLE_EQ(output[i], input[i]);
@@ -193,4 +211,3 @@ TEST(AlpIntegrationTest, LargeDoubleDataset) {
193211
} // namespace alp
194212
} // namespace util
195213
} // namespace arrow
196-

0 commit comments

Comments
 (0)