Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/flucoma/data/FluidTensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class FluidTensor //: public FluidTensorBase<T,N>
static_assert(std::is_convertible<U, T>::value,
"Cannot convert between container value types");
std::copy(x.begin(), x.end(), mContainer.begin());
std::cout << "Debug failing test (value) \n" << x << '\n' << *this;
}

template <typename U, size_t M>
Expand All @@ -117,6 +118,7 @@ class FluidTensor //: public FluidTensorBase<T,N>
"Cannot convert between container value types");

std::copy(x.begin(), x.end(), mContainer.begin());
std::cout << "Debug failing test (view) \n" << x << '\n' << *this;
}

/// Conversion assignment
Expand Down
14 changes: 9 additions & 5 deletions tests/data/TestFluidTensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,16 @@ TEST_CASE("FluidTensor can be copied","[FluidTensor]"){
}

SECTION("Copy conversion") {
const FluidTensor<double, 2> y(x);
CHECK(y.size() == x.size());
CHECK(y.rows() == x.rows());
CHECK(y.cols() == x.cols());
const FluidTensor<int, 2> x2{{0,1,2,3,4},{5,6,7,8,9}};
const FluidTensor<double, 2> y(x2);
CHECK(y.size() == x2.size());
CHECK(y.rows() == x2.rows());
CHECK(y.cols() == x2.cols());
CHECK(y.descriptor() == x.descriptor());
CHECK(std::equal(y.begin(),y.end(),x.begin()));
CHECK(std::equal(y.begin(),y.end(),x2.begin()));
std::cout << "Copy Conversion Debug" << y << '\n' << x2;


}
}

Expand Down
Loading