openDarkEngine icon indicating copy to clipboard operation
openDarkEngine copied to clipboard

Python bindings need tests/fixes

Open volca02 opened this issue 10 years ago • 3 comments

Example: using pytest.

#0  Opde::LightAtlas::getIndex (this=0x0) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/worldrep/LightmapAtlas.cpp:288
#1  0x00007ffff7b428c9 in Opde::LightMap::getAtlasIndex (this=<optimized out>) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/worldrep/LightmapAtlas.cpp:587
#2  0x00007ffff7b13381 in Opde::LightsForCell::getAtlasForPolygon (this=<optimized out>, face_id=face_id@entry=0) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/light/LightService.cpp:352
#3  0x00007ffff7b13f75 in Opde::LightService::getAtlasForCellPolygon (this=<optimized out>, cellID=<optimized out>, faceID=0) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/light/LightService.cpp:160
#4  0x00007ffff7b49402 in Opde::WRCell::createCellGeometry (this=0x1c6b070) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/worldrep/WRCell.cpp:426
#5  0x00007ffff7b46c6c in Opde::WorldRepService::loadFromChunk (this=this@entry=0xc67640, wrChunk=..., lightSize=<optimized out>) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/worldrep/WorldRepService.cpp:284
#6  0x00007ffff7b4767e in Opde::WorldRepService::onDBLoad (this=0xc67640, db=..., curmask=<optimized out>) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/worldrep/WorldRepService.cpp:126
#7  0x00007ffff7aef2a8 in Opde::DatabaseService::broadcastOnDBLoad (this=this@entry=0x912050, db=..., curmask=curmask@entry=203008) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/database/DatabaseService.cpp:268
#8  0x00007ffff7af027f in Opde::DatabaseService::recursiveMergeLoad (this=this@entry=0x912050, filename=..., loadMask=loadMask@entry=466688) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/database/DatabaseService.cpp:104
#9  0x00007ffff7af03ab in Opde::DatabaseService::load (this=0x912050, filename=..., loadMask=loadMask@entry=466688) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/services/database/DatabaseService.cpp:73
#10 0x00007ffff7b55483 in Opde::Python::DatabaseServiceBinder::load (self=<optimized out>, args=<optimized out>) at /home/volca/Projects/openDarkEngine/openDarkEngine/src/bindings/DatabaseServiceBinder.cpp:177

volca02 avatar Apr 28 '14 20:04 volca02

To be precise I get that backtrace when uncommenting

dbsrv.load("miss1.mis", opde.services.DBM_COMPLETE)

volca02 avatar Apr 28 '14 20:04 volca02

A weird C++ side exception when doing debug_frame from python:

Traceback (most recent call last):
  File "<string>", line 113, in <module>
RuntimeError: C++ side exception (/home/volca/Projects/openDarkEngine/openDarkEngine/src/bindings/LoopServiceBinder.cpp:98) : PythonException: <unknown exception type>
    Opde Exception (<unknown file> line 59) - Python : <unknown exception data>

volca02 avatar Apr 28 '14 20:04 volca02

That last one is probably caused by problems with gettattr on msg object - commenting these will stop that from happening:

#    opde.log_info("Comand field: " + msg.command)
#    opde.log_info("Comand params: " + str(msg.params))

Edit: still need to see why the exception didn't propagate well.

volca02 avatar Apr 28 '14 20:04 volca02