comparison OrthancServer/UnitTestsSources/UnitTestsMain.cpp @ 4273:0034f855c023

tuning log categories from command-line, and binary compat with orthanc framework 1.7.2
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Nov 2020 12:24:50 +0100
parents f0d81320f17f
children d7a50b7b8466
comparison
equal deleted inserted replaced
4272:1661544ea94d 4273:0034f855c023
124 ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("EFilm2"))); 124 ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("EFilm2")));
125 ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("ClearCanvas"))); 125 ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("ClearCanvas")));
126 ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("Dcm4Chee"))); 126 ASSERT_STREQ("Generic", EnumerationToString(StringToModalityManufacturer("Dcm4Chee")));
127 ASSERT_STREQ("GenericNoWildcardInDates", EnumerationToString(StringToModalityManufacturer("SyngoVia"))); 127 ASSERT_STREQ("GenericNoWildcardInDates", EnumerationToString(StringToModalityManufacturer("SyngoVia")));
128 ASSERT_STREQ("GenericNoWildcardInDates", EnumerationToString(StringToModalityManufacturer("AgfaImpax"))); 128 ASSERT_STREQ("GenericNoWildcardInDates", EnumerationToString(StringToModalityManufacturer("AgfaImpax")));
129
130 ASSERT_STREQ("default", EnumerationToString(StringToVerbosity("default")));
131 ASSERT_STREQ("verbose", EnumerationToString(StringToVerbosity("verbose")));
132 ASSERT_STREQ("trace", EnumerationToString(StringToVerbosity("trace")));
133 ASSERT_THROW(StringToVerbosity("nope"), OrthancException);
134
135 Logging::LogCategory c;
136 ASSERT_TRUE(Logging::LookupCategory(c, "generic")); ASSERT_EQ(Logging::LogCategory_GENERIC, c);
137 ASSERT_TRUE(Logging::LookupCategory(c, "plugins")); ASSERT_EQ(Logging::LogCategory_PLUGINS, c);
138 ASSERT_TRUE(Logging::LookupCategory(c, "rest")); ASSERT_EQ(Logging::LogCategory_REST, c);
139 ASSERT_TRUE(Logging::LookupCategory(c, "sqlite")); ASSERT_EQ(Logging::LogCategory_SQLITE, c);
140 ASSERT_TRUE(Logging::LookupCategory(c, "dicom")); ASSERT_EQ(Logging::LogCategory_DICOM, c);
141 ASSERT_FALSE(Logging::LookupCategory(c, "nope"));
142
143 ASSERT_EQ(5u, Logging::GetCategoriesCount());
144
145 for (size_t i = 0; i < Logging::GetCategoriesCount(); i++)
146 {
147 Logging::LogCategory c;
148 ASSERT_TRUE(Logging::LookupCategory(c, Logging::GetCategoryName(i)));
149 }
150
151 ASSERT_THROW(Logging::GetCategoryName(Logging::GetCategoriesCount()), OrthancException);
129 } 152 }
130 153
131 154
132 155
133 TEST(FontRegistry, Basic) 156 TEST(FontRegistry, Basic)
507 530
508 int main(int argc, char **argv) 531 int main(int argc, char **argv)
509 { 532 {
510 Logging::Initialize(); 533 Logging::Initialize();
511 Toolbox::InitializeGlobalLocale(NULL); 534 Toolbox::InitializeGlobalLocale(NULL);
512 Logging::EnableInfoLevel(true); 535 SetGlobalVerbosity(Verbosity_Verbose);
513 Toolbox::DetectEndianness(); 536 Toolbox::DetectEndianness();
514 SystemToolbox::MakeDirectory("UnitTestsResults"); 537 SystemToolbox::MakeDirectory("UnitTestsResults");
515 OrthancInitialize(); 538 OrthancInitialize();
516 539
517 ::testing::InitGoogleTest(&argc, argv); 540 ::testing::InitGoogleTest(&argc, argv);