Commit 039694a9 authored by Matthieu Schaller's avatar Matthieu Schaller

Fix crash in the unit tests related to the new way of constructing the cell...

Fix crash in the unit tests related to the new way of constructing the cell meta-data and snapshot names
parent e9a09e72
......@@ -896,6 +896,10 @@ void io_write_cell_offsets(hid_t h_grp, const int cdim[3], const double dim[3],
}
#endif
/* Abort if we don't have any cells yet (i.e. haven't constructed the space)
*/
if (nr_cells == 0) return;
double cell_width[3] = {width[0], width[1], width[2]};
/* Temporary memory for the cell-by-cell information */
......
......@@ -79,7 +79,8 @@ int main(int argc, char *argv[]) {
&hydro_properties, &cosmo);
/* Init spart */
stars_first_init_spart(&sp, &stars_properties);
stars_first_init_spart(&sp, &stars_properties, /*with_cosmology=*/0, cosmo.a,
cosmo.time);
/* Define an initial stellar mass. (for use when calling the feedback
* functions, the results are presented per initial stellar mass, so the
......
......@@ -83,7 +83,7 @@ int main(int argc, char *argv[]) {
unsigned long long cpufreq = 0;
clocks_set_cpufreq(cpufreq);
const char *base_name = "testSelectOutput";
// const char *base_name = "testSelectOutput";
size_t Ngas = 0, Ngpart = 0, Ngpart_background = 0, Nspart = 0, Nbpart = 0;
int flag_entropy_ICs = -1;
int periodic = 1;
......@@ -146,6 +146,8 @@ int main(int argc, char *argv[]) {
/* pseudo initialization of the engine */
message("Initialization of the engine.");
struct engine e;
e.physical_constants = &prog_const;
sprintf(e.snapshot_base_name, "testSelectOutput");
sprintf(e.run_name, "Select Output Test");
select_output_engine_init(&e, &s, &cosmo, &param_file, &cooling,
&hydro_properties);
......@@ -158,7 +160,7 @@ int main(int argc, char *argv[]) {
/* write output file */
message("Writing output.");
write_output_single(&e, base_name, &us, &us);
write_output_single(&e, &us, &us);
/* Clean-up */
message("Cleaning memory.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment