Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/domain/materials/MaterialRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ void MaterialRegistry::registerMaterialsFromJson(const std::string& jsonPath)
return;
}

std::cerr << "[MaterialRegistry] Parsed " << json.size()
<< " material entries from " << jsonPath << std::endl;
for (const auto& item : json) {
Material m = item.get<Material>();
std::cerr << "[MaterialRegistry] Registering material id=" << m.id
<< std::endl;
registerMaterial(m.id, std::move(m));
}
std::cerr << "[MaterialRegistry] Final count=" << count() << std::endl;
} catch (const std::exception& e) {
std::cerr << "[MaterialRegistry] Error parsing " << jsonPath
<< ": " << e.what() << std::endl;
Expand Down
5 changes: 5 additions & 0 deletions src/domain/physics/ParticleRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ void ParticleRegistry::registerParticlesFromJson(const std::string& jsonPath)
<< jsonPath << std::endl;
return;
}
std::cerr << "[ParticleRegistry] Parsed " << json.size()
<< " particle entries from " << jsonPath << std::endl;
for (const auto& item : json) {
Particle p = item.get<Particle>();
std::cerr << "[ParticleRegistry] Registering particle id=" << p.id
<< std::endl;
registerParticle(p.id, std::move(p));
}
std::cerr << "[ParticleRegistry] Final count=" << count() << std::endl;
} catch (const std::exception& e) {
std::cerr << "[ParticleRegistry] Error parsing " << jsonPath
<< ": " << e.what() << std::endl;
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/domain/test_MaterialRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ TEST_F(MaterialRegistryTest, LoadMaterialsFromJson)
out.close();
}

{
std::ifstream in(tmpPath);
std::string contents((std::istreambuf_iterator<char>(in)),
std::istreambuf_iterator<char>());
std::cerr << "[TEST] Material JSON path=" << tmpPath
<< " contents=" << contents << std::endl;
}

MaterialRegistry jsonReg;
jsonReg.registerMaterialsFromJson(tmpPath);

Expand Down
8 changes: 8 additions & 0 deletions tests/unit/domain/test_ParticleRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ TEST_F(ParticleRegistryTest, LoadFromJson)
out.close();
}

{
std::ifstream in(tmpPath);
std::string contents((std::istreambuf_iterator<char>(in)),
std::istreambuf_iterator<char>());
std::cerr << "[TEST] Particle JSON path=" << tmpPath
<< " contents=" << contents << std::endl;
}

ParticleRegistry jsonReg;
jsonReg.registerParticlesFromJson(tmpPath);

Expand Down
Loading