Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VerbosityLevel_UnitTests.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
12 
13 
14 namespace {
15 
16 
17 using Teuchos::ArrayView;
19 
20 
21 TEUCHOS_UNIT_TEST( VerbosityLevel, EVerbosityLevel_size )
22 {
24 }
25 
26 
27 TEUCHOS_UNIT_TEST( VerbosityLevel, getValidVerbLevels )
28 {
29  ECHO(ArrayView<const EVerbosityLevel> validVerbLevels = Teuchos::getValidVerbLevels());
30  TEST_EQUALITY(validVerbLevels.size(), Teuchos::EVerbosityLevel_size);
31  TEST_EQUALITY_CONST(validVerbLevels[0], Teuchos::VERB_DEFAULT);
32  TEST_EQUALITY_CONST(validVerbLevels[1], Teuchos::VERB_NONE);
33  TEST_EQUALITY_CONST(validVerbLevels[2], Teuchos::VERB_LOW);
34  TEST_EQUALITY_CONST(validVerbLevels[3], Teuchos::VERB_MEDIUM);
35  TEST_EQUALITY_CONST(validVerbLevels[4], Teuchos::VERB_HIGH);
36  TEST_EQUALITY_CONST(validVerbLevels[5], Teuchos::VERB_EXTREME);
37 }
38 
39 
41 {
42  ECHO(ArrayView<const std::string> validVerbLevelsNames =
44  TEST_EQUALITY(validVerbLevelsNames.size(), Teuchos::EVerbosityLevel_size);
45  TEST_EQUALITY_CONST(validVerbLevelsNames[0], "VERB_DEFAULT");
46  TEST_EQUALITY_CONST(validVerbLevelsNames[1], "VERB_NONE");
47  TEST_EQUALITY_CONST(validVerbLevelsNames[2], "VERB_LOW");
48  TEST_EQUALITY_CONST(validVerbLevelsNames[3], "VERB_MEDIUM");
49  TEST_EQUALITY_CONST(validVerbLevelsNames[4], "VERB_HIGH");
50  TEST_EQUALITY_CONST(validVerbLevelsNames[5], "VERB_EXTREME");
51 }
52 
53 
55 {
56  ECHO(ArrayView<const char * const> validVerbLevelsNamesRawStrings =
58  TEST_EQUALITY(validVerbLevelsNamesRawStrings.size(), Teuchos::EVerbosityLevel_size);
59  TEST_EQUALITY_CONST(std::strcmp(validVerbLevelsNamesRawStrings[0], "VERB_DEFAULT"), 0);
60  TEST_EQUALITY_CONST(std::strcmp(validVerbLevelsNamesRawStrings[1], "VERB_NONE"), 0);
61  TEST_EQUALITY_CONST(std::strcmp(validVerbLevelsNamesRawStrings[2], "VERB_LOW"), 0);
62  TEST_EQUALITY_CONST(std::strcmp(validVerbLevelsNamesRawStrings[3], "VERB_MEDIUM"), 0);
63  TEST_EQUALITY_CONST(std::strcmp(validVerbLevelsNamesRawStrings[4], "VERB_HIGH"), 0);
64  TEST_EQUALITY_CONST(std::strcmp(validVerbLevelsNamesRawStrings[5], "VERB_EXTREME"), 0);
65 }
66 
67 
68 } // namespace
EVerbosityLevel
Verbosity level.
Generate a high level of output.
Generate only a minimal amount of output.
TEUCHOSCORE_LIB_DLL_EXPORT ArrayView< const EVerbosityLevel > getValidVerbLevels()
#define ECHO(statement)
Echo the given statement before it is executed.
constexpr const int EVerbosityLevel_size
#define TEST_EQUALITY(v1, v2)
Assert the equality of v1 and v2.
#define TEUCHOS_UNIT_TEST(TEST_GROUP, TEST_NAME)
Macro for defining a (non-templated) unit test.
Generate the most output possible.
Unit testing support.
#define TEST_EQUALITY_CONST(v1, v2)
Assert the equality of v1 and constant v2.
Generate no output.
TEUCHOSCORE_LIB_DLL_EXPORT ArrayView< const std::string > getValidVerbLevelsNames()
Nonowning array view.
Generate more output.
Generate output as defined by the object.
TEUCHOSCORE_LIB_DLL_EXPORT ArrayView< const char *const > getValidVerbLevelsNamesRawStrings()