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

Function TEST_F

cpp/src/arrow/sparse_tensor_test.cc:269–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267class TestSparseCOOTensor : public TestSparseCOOTensorBase<Int64Type> {};
268
269TEST_F(TestSparseCOOTensor, CreationEmptyTensor) {
270 SparseCOOTensor st1(int64(), this->shape_);
271 SparseCOOTensor st2(int64(), this->shape_, this->dim_names_);
272
273 ASSERT_EQ(0, st1.non_zero_length());
274 ASSERT_EQ(0, st2.non_zero_length());
275
276 ASSERT_EQ(24, st1.size());
277 ASSERT_EQ(24, st2.size());
278
279 ASSERT_EQ(std::vector<std::string>({"foo", "bar", "baz"}), st2.dim_names());
280 ASSERT_EQ("foo", st2.dim_name(0));
281 ASSERT_EQ("bar", st2.dim_name(1));
282 ASSERT_EQ("baz", st2.dim_name(2));
283
284 ASSERT_EQ(std::vector<std::string>({}), st1.dim_names());
285 ASSERT_EQ("", st1.dim_name(0));
286 ASSERT_EQ("", st1.dim_name(1));
287 ASSERT_EQ("", st1.dim_name(2));
288}
289
290TEST_F(TestSparseCOOTensor, CreationFromZeroTensor) {
291 const auto dense_size =

Callers

nothing calls this directly

Calls 15

WrapFunction · 0.85
AssertNumericDataEqualFunction · 0.85
AssertCOOIndexFunction · 0.85
raw_dataMethod · 0.80
sparse_indexMethod · 0.80
indicesMethod · 0.80
is_row_majorMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
MakeFunction · 0.70
non_zero_lengthMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected