Skip to content

Commit

Permalink
Some include cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Mar 2, 2016
1 parent e319a36 commit 08d3895
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 30 deletions.
2 changes: 2 additions & 0 deletions cpp/src/arrow/array-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <gtest/gtest.h>

#include <cstdint>
#include <cstdlib>
#include <memory>
#include <string>
#include <vector>
Expand All @@ -29,6 +30,7 @@
#include "arrow/types/primitive.h"
#include "arrow/util/buffer.h"
#include "arrow/util/memory-pool.h"
#include "arrow/util/status.h"

using std::string;
using std::vector;
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#define ARROW_ARRAY_H

#include <cstdint>
#include <cstdlib>
#include <memory>

#include "arrow/type.h"
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
#include <vector>

#include "arrow/type.h"
#include "arrow/util/buffer.h"
#include "arrow/util/macros.h"
#include "arrow/util/status.h"

namespace arrow {

class Array;
class MemoryPool;
class PoolBuffer;

static constexpr int64_t MIN_BUILDER_CAPACITY = 1 << 8;

Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/types/primitive-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <gtest/gtest.h>

#include <cstdint>
#include <cstdlib>
#include <memory>
#include <string>
#include <vector>
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/types/primitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <cstdint>
#include <cstring>
#include <memory>
#include <string>

#include "arrow/array.h"
Expand Down
27 changes: 12 additions & 15 deletions cpp/src/arrow/types/string-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@
#include "arrow/types/test-common.h"
#include "arrow/util/status.h"

using std::string;
using std::unique_ptr;
using std::vector;

namespace arrow {

class Buffer;

TEST(TypesTest, TestCharType) {
CharType t1(5);
Expand All @@ -45,7 +42,7 @@ TEST(TypesTest, TestCharType) {
ASSERT_TRUE(t1.nullable);
ASSERT_EQ(t1.size, 5);

ASSERT_EQ(t1.ToString(), string("char(5)"));
ASSERT_EQ(t1.ToString(), std::string("char(5)"));

// Test copy constructor
CharType t2 = t1;
Expand All @@ -63,7 +60,7 @@ TEST(TypesTest, TestVarcharType) {
ASSERT_EQ(t1.size, 5);
ASSERT_EQ(t1.physical_type.size, 6);

ASSERT_EQ(t1.ToString(), string("varchar(5)"));
ASSERT_EQ(t1.ToString(), std::string("varchar(5)"));

// Test copy constructor
VarcharType t2 = t1;
Expand All @@ -78,7 +75,7 @@ TEST(TypesTest, TestStringType) {
StringType str_nn(false);

ASSERT_EQ(str.type, TypeEnum::STRING);
ASSERT_EQ(str.name(), string("string"));
ASSERT_EQ(str.name(), std::string("string"));
ASSERT_TRUE(str.nullable);
ASSERT_FALSE(str_nn.nullable);
}
Expand Down Expand Up @@ -111,11 +108,11 @@ class TestStringContainer : public ::testing::Test {
}

protected:
vector<int32_t> offsets_;
vector<char> chars_;
vector<uint8_t> nulls_;
std::vector<int32_t> offsets_;
std::vector<char> chars_;
std::vector<uint8_t> nulls_;

vector<string> expected_;
std::vector<std::string> expected_;

std::shared_ptr<Buffer> value_buf_;
std::shared_ptr<Buffer> offsets_buf_;
Expand Down Expand Up @@ -188,17 +185,17 @@ class TestStringBuilder : public TestBuilder {
protected:
TypePtr type_;

unique_ptr<StringBuilder> builder_;
unique_ptr<StringArray> result_;
std::unique_ptr<StringBuilder> builder_;
std::unique_ptr<StringArray> result_;
};

TEST_F(TestStringBuilder, TestAttrs) {
ASSERT_FALSE(builder_->value_builder()->nullable());
}

TEST_F(TestStringBuilder, TestScalarAppend) {
vector<string> strings = {"a", "bb", "", "", "ccc"};
vector<uint8_t> is_null = {0, 0, 0, 1, 0};
std::vector<std::string> strings = {"a", "bb", "", "", "ccc"};
std::vector<uint8_t> is_null = {0, 0, 0, 1, 0};

int N = strings.size();
int reps = 1000;
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/arrow/types/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
#include "arrow/type.h"
#include "arrow/types/integer.h"
#include "arrow/types/list.h"
#include "arrow/util/buffer.h"
#include "arrow/util/status.h"

namespace arrow {

class ArrayBuilder;
class Buffer;
class MemoryPool;

struct CharType : public DataType {
int size;
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/types/struct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "arrow/types/struct.h"

#include <cstdlib>
#include <memory>
#include <sstream>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/types/union.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "arrow/types/union.h"

#include <cstdlib>
#include <sstream>
#include <string>
#include <vector>
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/arrow/util/bit-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
#include <cstdlib>
#include <memory>

#include "arrow/util/buffer.h"

namespace arrow {

class Buffer;
class Status;

namespace util {
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/util/buffer-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
// under the License.

#include <gtest/gtest.h>
#include <cstdlib>
#include <cstdint>
#include <limits>
#include <memory>
#include <string>

#include "arrow/test-util.h"
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/util/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#define ARROW_UTIL_BUFFER_H

#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <memory>

Expand Down
3 changes: 0 additions & 3 deletions cpp/src/arrow/util/memory-pool-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@
#include <limits>

#include "arrow/test-util.h"
#include "arrow/util/buffer.h"
#include "arrow/util/memory-pool.h"
#include "arrow/util/status.h"

using std::string;

namespace arrow {

TEST(DefaultMemoryPool, MemoryTracking) {
Expand Down
1 change: 0 additions & 1 deletion cpp/src/arrow/util/memory-pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <cstdlib>
#include <sstream>
#include <thread>
#include <mutex>

#include "arrow/util/status.h"
Expand Down
2 changes: 0 additions & 2 deletions cpp/src/arrow/util/memory-pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
#define ARROW_UTIL_MEMORY_POOL_H

#include <cstdint>
#include <memory>

namespace arrow {

class Buffer;
class Status;

class MemoryPool {
Expand Down

0 comments on commit 08d3895

Please sign in to comment.