commit 66eaaa94f7e88d6515f1e22b97bfabbfa693e423
parent 8c395913781566989ef8388b2a847b88d35e8c34
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date: Thu, 25 Aug 2016 02:13:12 +0300
Add test for replacing an argument
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/tests/vec_test.cpp b/tests/vec_test.cpp
@@ -328,4 +328,17 @@ TEST(test_arg_access)
CHECK(v2[9] == 10);
}
+TEST(test_arg_replace)
+{
+ univector<float, 10> v1 = counter();
+ univector<float, 10> v2 = -counter();
+ auto e1 = to_pointer(v1) * 10;
+ std::get<0>(e1.args) = to_pointer(v2);
+ univector<float, 10> v3 = e1;
+ CHECK(v3[0] == 0);
+ CHECK(v3[1] == -10);
+ CHECK(v3[2] == -20);
+ CHECK(v3[9] == -90);
+}
+
int main(int argc, char** argv) { return testo::run_all("", true); }