From 259d030fed339108950af85b81e4261a58bf4abe Mon Sep 17 00:00:00 2001 From: laurence Date: Wed, 25 Sep 2013 10:11:36 +0100 Subject: [PATCH 01/21] ENH: Update tests for PtrList and sort --- applications/test/PtrList/Test-PtrList.C | 15 +++++++++++++++ applications/test/sort/Test-sortList.C | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/applications/test/PtrList/Test-PtrList.C b/applications/test/PtrList/Test-PtrList.C index 9241460a59..664dd5b501 100644 --- a/applications/test/PtrList/Test-PtrList.C +++ b/applications/test/PtrList/Test-PtrList.C @@ -32,6 +32,8 @@ Description #include "scalar.H" #include "IOstreams.H" #include "PtrList.H" +#include "plane.H" +#include "DynamicList.H" using namespace Foam; @@ -76,6 +78,7 @@ int main(int argc, char *argv[]) { PtrList list1(10); PtrList list2(15); + PtrList listApp; forAll(list1, i) { @@ -87,9 +90,14 @@ int main(int argc, char *argv[]) list2.set(i, new Scalar(10 + 1.3*i)); } + for (label i = 0; i < 5; ++i) + { + listApp.append(new Scalar(1.3*i)); + } Info<<"list1: " << list1 << endl; Info<<"list2: " << list2 << endl; + Info<<"listApp: " << listApp << endl; Info<<"indirectly delete some items via set(.., 0) :" << endl; for (label i = 0; i < 3; i++) @@ -115,6 +123,13 @@ int main(int argc, char *argv[]) Info<<"list2: " << list2 << endl; Info<<"list3: " << list3 << endl; + PtrList planes; + planes.append(new plane(vector::one, vector::one)); + planes.append(new plane(vector(1,2,3), vector::one)); + + forAll(planes, p) + Info<< "plane " << planes[p] << endl; + Info<< nl << "Done." << endl; return 0; } diff --git a/applications/test/sort/Test-sortList.C b/applications/test/sort/Test-sortList.C index 0521159ebb..d92a4a7ad4 100644 --- a/applications/test/sort/Test-sortList.C +++ b/applications/test/sort/Test-sortList.C @@ -50,11 +50,18 @@ int main(int argc, char *argv[]) labelList a(orig); sortedOrder(a, order); + SortableList