| 267 | class TestSparseCOOTensor : public TestSparseCOOTensorBase<Int64Type> {}; |
| 268 | |
| 269 | TEST_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 | |
| 290 | TEST_F(TestSparseCOOTensor, CreationFromZeroTensor) { |
| 291 | const auto dense_size = |
nothing calls this directly
no test coverage detected