Harden API wrapper error paths and water bindings
This commit is contained in:
@@ -5,30 +5,38 @@
|
||||
int main()
|
||||
{
|
||||
if (sphlite::PhaseSolid != SPHLITE_PHASE_SOLID ||
|
||||
sphlite::StatusActive != SPHLITE_STATUS_ACTIVE) {
|
||||
sphlite::PhaseWater != SPHLITE_PHASE_WATER ||
|
||||
sphlite::StatusActive != SPHLITE_STATUS_ACTIVE ||
|
||||
sphlite::StatusFailed != SPHLITE_STATUS_FAILED) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sphlite::Session session;
|
||||
sphlite::Version version = sphlite::version();
|
||||
if (version.major != 0 || version.minor != 2 || version.patch != 1) {
|
||||
return 1;
|
||||
{
|
||||
sphlite::Session session;
|
||||
sphlite::Version version = sphlite::version();
|
||||
if (version.major != 0 || version.minor != 2 || version.patch != 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string input = std::string(SPHLITE_TEST_DATA_DIR) + "/minimal_particles_011.inp";
|
||||
sphlite::read_inp(input);
|
||||
sphlite::build_model();
|
||||
if (sphlite::particle_count() != 4) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
sphlite::ParticleState state = sphlite::particle_state();
|
||||
if (state.particle_id_ext.size() != 4 || state.phase[0] != sphlite::PhaseSolid) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
std::string input = std::string(SPHLITE_TEST_DATA_DIR) + "/minimal_particles_011.inp";
|
||||
sphlite::read_inp(input);
|
||||
sphlite::build_model();
|
||||
if (sphlite::particle_count() != 4) {
|
||||
try {
|
||||
(void)sphlite::particle_count();
|
||||
return 1;
|
||||
} catch (const sphlite::Error &) {
|
||||
}
|
||||
|
||||
sphlite::ParticleState state = sphlite::particle_state();
|
||||
if (state.particle_id_ext.size() != 4 || state.phase[0] != sphlite::PhaseSolid) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
session.close();
|
||||
|
||||
sphlite::Session water_session;
|
||||
std::string water_input = std::string(SPHLITE_TEST_DATA_DIR) + "/water_minimal_020.inp";
|
||||
sphlite::read_inp(water_input);
|
||||
|
||||
Reference in New Issue
Block a user