]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a test for VectorMemory<std::vector<T>>. 5630/head
authorDavid Wells <wellsd2@rpi.edu>
Fri, 15 Dec 2017 22:27:59 +0000 (17:27 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Fri, 15 Dec 2017 22:27:59 +0000 (17:27 -0500)
tests/lac/vector_memory_std_vector.cc [new file with mode: 0644]
tests/lac/vector_memory_std_vector.output [new file with mode: 0644]

diff --git a/tests/lac/vector_memory_std_vector.cc b/tests/lac/vector_memory_std_vector.cc
new file mode 100644 (file)
index 0000000..cf6e956
--- /dev/null
@@ -0,0 +1,30 @@
+#include <deal.II/lac/vector_memory.h>
+#include <deal.II/lac/vector_memory.templates.h>
+
+#include <vector>
+
+#include "../tests.h"
+
+// Check that we can create VectorMemory objects with vector-like classes in
+// the standard library.
+
+template <typename VectorType>
+void test_std_vector_pointer()
+{
+  GrowingVectorMemory<VectorType> mem;
+
+  std::vector<typename VectorMemory<VectorType>::Pointer> va;
+  va.push_back(typename VectorMemory<VectorType>::Pointer(mem));
+  va.emplace_back(mem);
+}
+
+
+
+int main()
+{
+  initlog();
+  PrimitiveVectorMemory<std::vector<double>> primitive_memory;
+  test_std_vector_pointer<std::vector<double>>();
+
+  deallog << "OK" << std::endl;
+}
diff --git a/tests/lac/vector_memory_std_vector.output b/tests/lac/vector_memory_std_vector.output
new file mode 100644 (file)
index 0000000..0fd8fc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+DEAL::OK

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.