MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/flight/sql/odbc/odbc_impl/util_test.cc:90–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90TEST(Utils, Time32ToTimeStampArray) {
91 std::vector<int32_t> input_data = {14896, 17820};
92
93 const auto seconds_from_epoch = GetTodayTimeFromEpoch();
94 std::vector<int64_t> expected_data;
95 expected_data.reserve(2);
96
97 for (const auto& item : input_data) {
98 expected_data.emplace_back(item + seconds_from_epoch * 1000);
99 }
100
101 std::shared_ptr<Array> expected;
102 auto timestamp_field = field("timestamp_field", timestamp(TimeUnit::MILLI));
103 ArrayFromVector<TimestampType, int64_t>(timestamp_field->type(), expected_data,
104 &expected);
105
106 TestTime32ArrayConversion(input_data, expected, CDataType_TIMESTAMP, Type::TIMESTAMP);
107}
108
109TEST(Utils, Time64ToTimeStampArray) {
110 std::vector<int64_t> input_data = {1579489200000, 1646881200000};

Callers

nothing calls this directly

Calls 12

GetTodayTimeFromEpochFunction · 0.85
TestArrayConversionFunction · 0.85
ConvertToDBMSVerFunction · 0.85
emplace_backMethod · 0.80
fieldFunction · 0.50
timestampFunction · 0.50
time64Function · 0.50
reserveMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected