Release SPHLite 0.8.2
This commit is contained in:
@@ -9,6 +9,16 @@ static int fail(const char *message)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int file_exists(const char *path)
|
||||
{
|
||||
FILE *file = fopen(path, "r");
|
||||
if (file == NULL) {
|
||||
return 0;
|
||||
}
|
||||
fclose(file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char path[1024];
|
||||
@@ -90,6 +100,9 @@ int main(void)
|
||||
if (sphlite_set_output_interval(0) != -1) {
|
||||
return fail("non-positive output interval did not return -1");
|
||||
}
|
||||
if (sphlite_write_vtu(NULL) != -1) {
|
||||
return fail("null VTU path did not return -1");
|
||||
}
|
||||
if (sphlite_get_water_summary(NULL, water_momentum, &max_pressure,
|
||||
&min_density, &max_density) != -1) {
|
||||
return fail("null water summary mass pointer did not return -1");
|
||||
@@ -238,7 +251,7 @@ int main(void)
|
||||
|
||||
ierr = sphlite_get_version(&major, &minor, &patch);
|
||||
if (ierr != 0) return fail("get_version failed");
|
||||
if (major != 0 || minor != 8 || patch != 1) return fail("unexpected version");
|
||||
if (major != 0 || minor != 8 || patch != 2) return fail("unexpected version");
|
||||
|
||||
snprintf(path, sizeof(path), "%s/minimal_particles_011.inp", SPHLITE_TEST_DATA_DIR);
|
||||
ierr = sphlite_read_inp(path);
|
||||
@@ -320,6 +333,10 @@ int main(void)
|
||||
if (ierr != 0) return fail("set output directory failed");
|
||||
ierr = sphlite_write_output(step, time);
|
||||
if (ierr != 0) return fail("write output failed");
|
||||
snprintf(path, sizeof(path), "%s/c_api_manual.vtu", SPHLITE_TEST_WORK_DIR);
|
||||
ierr = sphlite_write_vtu(path);
|
||||
if (ierr != 0) return fail("write VTU failed");
|
||||
if (!file_exists(path)) return fail("manual VTU file missing");
|
||||
|
||||
snprintf(path, sizeof(path), "%s/restart_c_api.tmp", SPHLITE_TEST_WORK_DIR);
|
||||
ierr = sphlite_write_restart(path);
|
||||
|
||||
Reference in New Issue
Block a user