From d678794b1871649bb9253c5279f0108a598179c3 Mon Sep 17 00:00:00 2001 From: Ryan Levy Date: Fri, 6 May 2016 13:10:37 -0400 Subject: [PATCH] test: check read in of external data file --- test/parmsTest.cpp | 23 +++++++++++++++++++++++ test/write_test_files.hpp | 10 +++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/test/parmsTest.cpp b/test/parmsTest.cpp index c0394cd..e54a703 100644 --- a/test/parmsTest.cpp +++ b/test/parmsTest.cpp @@ -71,6 +71,29 @@ TEST(Parameters,DataInParam){ boost::filesystem::remove(pf); } +TEST(Parameters,DataInFile){ +std::string pf=alps::temporary_filename("in_file.dat"); + write_minimal_input_file(pf); + + //fake input + alps::params p; + MaxEntSimulation::define_parameters(p); + p["BETA"]=2; + p["DATA"]=pf; + p["NDAT"] = 5; + + ContiParameters c(p); + EXPECT_EQ(c.ndat(),5); + EXPECT_EQ(c.T(),0.5); + + for(int i=0;i