Skip to content

Commit

Permalink
Restore move-only type in nda_array_adapter test
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Jul 30, 2024
1 parent 4bb88f4 commit 43fc60a
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions test/c++/nda_array_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ struct foo {
struct bar {
int j = 0;
bar(foo &&f) : j(f.i) { f.i = 0; }
bar(const foo &f) : j(f.i) {}
};

TEST(NDA, ArrayAdapterBasics) {
Expand Down Expand Up @@ -72,21 +71,6 @@ TEST(NDA, ArrayAdapterMoveElements) {
}

TEST(NDA, ArrayAdapterMoveElements2) {
// test moving elements from one array to another using an array adapter
nda::array<foo, 2> A_foo(2, 2);
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j) A_foo(i, j).i = 1 + i + 10 * j;

auto f2 = [A_foo2 = std::move(A_foo)](long i, long j) { return bar{A_foo2(i, j)}; };
auto A_bar = nda::array<bar, 2>{nda::array_adapter{std::array{2, 2}, f2}};

EXPECT_TRUE(A_foo.empty());
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 2; ++j) { EXPECT_EQ(A_bar(i, j).j, (1 + i + 10 * j)); }
}
}

TEST(NDA, ArrayAdapterMoveElements3) {
// test moving elements from one array to another using nda::map instead of an array adapter
nda::array<foo, 2> A_foo(2, 2);
for (int i = 0; i < 2; ++i)
Expand Down

0 comments on commit 43fc60a

Please sign in to comment.