From a81d7577214d69fe8c6b63e992e50677911c35da Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 10 Nov 2023 10:13:47 +0100 Subject: [PATCH] COMP: add missing include for SortList - extend test to include partition + sort --- applications/test/partition-sort/Make/files | 3 + applications/test/partition-sort/Make/options | 2 + .../partition-sort/Test-partition-sort.cxx | 97 +++++++++++++++++++ applications/test/sort/Make/files | 2 +- applications/test/sort/Make/options | 4 +- .../{Test-sortList.C => Test-sortList.cxx} | 1 + .../IndirectLists/SortList/SortListI.H | 2 + 7 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 applications/test/partition-sort/Make/files create mode 100644 applications/test/partition-sort/Make/options create mode 100644 applications/test/partition-sort/Test-partition-sort.cxx rename applications/test/sort/{Test-sortList.C => Test-sortList.cxx} (99%) diff --git a/applications/test/partition-sort/Make/files b/applications/test/partition-sort/Make/files new file mode 100644 index 0000000000..b10c2f815a --- /dev/null +++ b/applications/test/partition-sort/Make/files @@ -0,0 +1,3 @@ +Test-partition-sort.cxx + +EXE = $(FOAM_USER_APPBIN)/Test-partition-sort diff --git a/applications/test/partition-sort/Make/options b/applications/test/partition-sort/Make/options new file mode 100644 index 0000000000..18e6fe47af --- /dev/null +++ b/applications/test/partition-sort/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = */ +/* EXE_LIBS = */ diff --git a/applications/test/partition-sort/Test-partition-sort.cxx b/applications/test/partition-sort/Test-partition-sort.cxx new file mode 100644 index 0000000000..fe5629b1c0 --- /dev/null +++ b/applications/test/partition-sort/Test-partition-sort.cxx @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2023 OpenCFD Ltd. +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + Test-partition-sort + +Description + Test behaviour of std::partition, etc. + +\*---------------------------------------------------------------------------*/ + +#include "IndirectList.H" +#include "SortList.H" +#include "Random.H" + +#include +#include + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + labelList input(40); + labelList order(Foam::identity(input.size())); + + UIndirectList