diagnose_test.cpp
Go to the documentation of this file.
2 #include <gtest/gtest.h>
4 #include <test/test-models/good/services/test_lp.hpp>
8 
9 class ServicesDiagnose : public testing::Test {
10 public:
12  : init(init_ss),
14  model(context, &model_ss) {}
15 
16  std::stringstream init_ss, parameter_ss, model_ss;
21  stan_model model;
22 };
23 
24 
26  unsigned int seed = 0;
27  unsigned int chain = 1;
28  double init_radius = 0;
29 
30 
31 
33  seed, chain, init_radius,
34  1e-6, 1e-6,
35  interrupt,
37  EXPECT_EQ("", model_ss.str());
38 
39 
40  EXPECT_EQ(1, logger.find_info("TEST GRADIENT MODE"));
41  EXPECT_EQ(1, logger.find_info("Log probability=3.218"));
42 
43  EXPECT_EQ("0,0\n", init_ss.str());
44 
45  EXPECT_TRUE(parameter_ss.str().find("Log probability=3.218") != std::string::npos);
46 }
stan::callbacks::stream_writer parameter
int diagnose(Model &model, stan::io::var_context &init, unsigned int random_seed, unsigned int chain, double init_radius, double epsilon, double error, callbacks::interrupt &interrupt, callbacks::logger &logger, callbacks::writer &init_writer, callbacks::writer &parameter_writer)
Definition: diagnose.hpp:43
stan::io::empty_var_context context
stan::callbacks::interrupt interrupt
stan::test::unit::instrumented_logger logger
stan::callbacks::stream_writer init
std::stringstream model_ss
unsigned int seed
Definition: runWimpSim.h:102
chain
Check that an output directory exists.
std::stringstream parameter_ss
std::stringstream init_ss
const XML_Char * context
Definition: expat.h:434
unsigned int find_info(const std::string &msg)
Float_t e
Definition: plot.C:35
TEST_F(ServicesDiagnose, diagnose)
const XML_Char XML_Content * model
Definition: expat.h:151