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

Function TEST

cpp/src/arrow/ipc/tensor_test.cc:567–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565} // namespace
566
567TEST(TestSparseCSFIndex, RejectInconsistentBufferCounts) {
568 // ndim == 1 is not a valid CSF index (it has no indptr buffers), and used to
569 // reach SparseCSFIndex's constructor with an empty indptr vector.
570 ASSERT_OK_AND_ASSIGN(auto message,
571 MakeCSFSparseTensorMessage(/*shape=*/{4}, /*num_indptr_buffers=*/0,
572 /*num_indices_buffers=*/1,
573 /*axis_order_size=*/1));
574 ASSERT_RAISES(Invalid, ReadSparseTensor(*message));
575
576 // Too many indices buffers for the declared number of dimensions, which used
577 // to write past the end of the fixed-size index vectors.
578 ASSERT_OK_AND_ASSIGN(
579 message, MakeCSFSparseTensorMessage(/*shape=*/{4, 4}, /*num_indptr_buffers=*/1,
580 /*num_indices_buffers=*/3,
581 /*axis_order_size=*/2));
582 ASSERT_RAISES(Invalid, ReadSparseTensor(*message));
583
584 // axisOrder and indicesBuffers lengths disagree (out-of-bounds read).
585 ASSERT_OK_AND_ASSIGN(
586 message, MakeCSFSparseTensorMessage(/*shape=*/{4, 4}, /*num_indptr_buffers=*/1,
587 /*num_indices_buffers=*/2,
588 /*axis_order_size=*/3));
589 ASSERT_RAISES(Invalid, ReadSparseTensor(*message));
590}
591
592TEST(TestSparseCSFIndex, RejectInconsistentPayloadBufferCounts) {
593 ASSERT_OK_AND_ASSIGN(auto message,

Callers

nothing calls this directly

Calls 7

ReadSparseTensorFunction · 0.85
ReadSparseTensorPayloadFunction · 0.85
MakeSparseTensorPayloadFunction · 0.85
FromStringFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.50
MakeFunction · 0.50

Tested by

no test coverage detected