Skip to content

Commit

Permalink
Fix size of memory passed to fmi2DeSerializeFMUstate()
Browse files Browse the repository at this point in the history
and don't skip test on Linux

see CATIA-Systems#57
[skip ci]
  • Loading branch information
t-sommer committed Nov 16, 2018
1 parent 4e01373 commit cdf83f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fmpy/fmi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def deSerializeFMUstate(self, serializedState, state):
state the FMU state
"""

buffer = create_string_buffer(serializedState)
buffer = create_string_buffer(serializedState, size=len(serializedState))
self.fmi2DeSerializeFMUstate(self.component, buffer, len(buffer), byref(state))

# Getting partial derivatives
Expand Down
4 changes: 1 addition & 3 deletions tests/test_serialize_fmu_state.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import unittest
from unittest import skipIf
from fmpy import read_model_description, extract, platform
from fmpy import read_model_description, extract
from fmpy.fmi2 import FMU2Slave
from fmpy.util import download_test_file
import shutil


class SerializeFMUStateTest(unittest.TestCase):

@skipIf(platform == 'linux64', "Crashes on Linux")
def test_serialize_fmu_state(self):

fmu_filename = 'Rectifier.fmu'
Expand Down

0 comments on commit cdf83f7

Please sign in to comment.