/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/MessageService/test/UnitTestClient_G.cc
41 строка
1 KB
Andrea Bocci
Use a more correct value of Pi for MessageLogger unit tests
15 мар 2022, 09:46
Не верифицирован
15 мар 2022, 09:46
ff9439e
Код
Авторство
О чём код?
#include <cmath> #include <iomanip> #include <iostream> #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/global/EDAnalyzer.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/StreamID.h" namespace edmtest { class UnitTestClient_G : public edm::global::EDAnalyzer<> { public: explicit UnitTestClient_G(edm::ParameterSet const&) {} void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override; }; void UnitTestClient_G::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const { if (!edm::isMessageProcessingSetUp()) { std::cerr << "??? It appears that Message Processing is not Set Up???\n\n"; } double d = M_PI; edm::LogWarning("cat_A") << "Test of std::setprecision(p):" << " Pi with precision 12 is " << std::setprecision(12) << d; for (int i = 0; i < 10; ++i) { edm::LogInfo("cat_B") << "\t\tEmit Info level message " << i + 1; } for (int i = 0; i < 15; ++i) { edm::LogWarning("cat_C") << "\t\tEmit Warning level message " << i + 1; } } } // namespace edmtest using edmtest::UnitTestClient_G; DEFINE_FWK_MODULE(UnitTestClient_G);