diff --git a/applications/test/CircularBuffer/Make/files b/applications/test/CircularBuffer/Make/files new file mode 100644 index 0000000000..72687d6670 --- /dev/null +++ b/applications/test/CircularBuffer/Make/files @@ -0,0 +1,3 @@ +Test-CircularBuffer.C + +EXE = $(FOAM_USER_APPBIN)/Test-CircularBuffer diff --git a/applications/test/CircularBuffer/Make/options b/applications/test/CircularBuffer/Make/options new file mode 100644 index 0000000000..18e6fe47af --- /dev/null +++ b/applications/test/CircularBuffer/Make/options @@ -0,0 +1,2 @@ +/* EXE_INC = */ +/* EXE_LIBS = */ diff --git a/applications/test/CircularBuffer/Test-CircularBuffer.C b/applications/test/CircularBuffer/Test-CircularBuffer.C new file mode 100644 index 0000000000..eed9b26ed1 --- /dev/null +++ b/applications/test/CircularBuffer/Test-CircularBuffer.C @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2022 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-CircularBuffer + +Description + Basic tests for CircularBuffer behaviour and characteristics + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "ListOps.H" +#include "CircularBuffer.H" +#include "StringStream.H" +#include "FlatOutput.H" + +using namespace Foam; + +template +inline Ostream& report +( + const CircularBuffer& buf, + bool debugOutput = true +) +{ + buf.writeList(Info, 0); + if (debugOutput) + { + Info<< " : "; + buf.info(Info); + } + else + { + Info<< nl; + } + return Info; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + CircularBuffer