From aeb19b591390fe7b413fdece7b69cadd62a9ac0b Mon Sep 17 00:00:00 2001 From: James Willis <james.s.willis@durham.ac.uk> Date: Tue, 29 Mar 2016 11:08:31 +0100 Subject: [PATCH] Added a parameter of type double to testParser. --- tests/testParser.c | 5 ++++- tests/testParserInput.yaml | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/testParser.c b/tests/testParser.c index 04745c5a70..55b3adb610 100644 --- a/tests/testParser.c +++ b/tests/testParser.c @@ -33,6 +33,7 @@ int main(int argc, char *argv[]) { int no_of_threads = 0; int no_of_time_steps = 0; float max_h = 0.0f; + double start_time = 0.0; char ic_file [PARSER_MAX_LINE_SIZE]; /* Read the parameter file. */ @@ -47,14 +48,16 @@ int main(int argc, char *argv[]) { parser_get_param_int(¶m_file,"no_of_threads",&no_of_threads); parser_get_param_int(¶m_file,"no_of_time_steps",&no_of_time_steps); parser_get_param_float(¶m_file,"max_h",&max_h); + parser_get_param_double(¶m_file,"start_time",&start_time); parser_get_param_string(¶m_file,"ic_file",ic_file); /* Print the variables to check their values are correct. */ - printf("no_of_threads: %d, no_of_time_steps: %d, max_h: %f, ic_file: %s\n",no_of_threads, no_of_time_steps, max_h, ic_file); + printf("no_of_threads: %d, no_of_time_steps: %d, max_h: %f, start_time: %lf, ic_file: %s\n",no_of_threads, no_of_time_steps, max_h, start_time, ic_file); assert(no_of_threads == 16); assert(no_of_time_steps == 10); assert(fabs(max_h - 1.1255) < 0.00001); + assert(fabs(start_time - 1.23456789) < 0.00001); assert(strcmp(ic_file,"ic_file.ini") == 0); /*strcmp returns 0 if correct.*/ return 0; diff --git a/tests/testParserInput.yaml b/tests/testParserInput.yaml index 08a488b04f..d695e6a8dd 100644 --- a/tests/testParserInput.yaml +++ b/tests/testParserInput.yaml @@ -1,7 +1,9 @@ --- no_of_threads: 16 # The number of threads that will be used. no_of_time_steps: 10 -max_h: 1.1255 +max_h: 1.1255 +start_time: 1.23456789 #Input file -ic_file: ic_file.ini +ic_file: ic_file.ini + ... -- GitLab