------------------------------------------------------------
revno: 1821
committer: Václav Šmilauer <[email protected]>
branch nick: trunk
timestamp: Tue 2009-11-24 20:24:12 +0100
message:
  Regression check that NULL state throws (if there is a material) as well.
modified:
  py/tests/omega.py


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to 
https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'py/tests/omega.py'
--- py/tests/omega.py	2009-11-24 19:12:10 +0000
+++ py/tests/omega.py	2009-11-24 19:24:12 +0000
@@ -27,6 +27,13 @@
 		b.state=State() #should be CpmState()
 		O.bodies.append(b)
 		self.assertRaises(RuntimeError,lambda: O.step()) # throws runtime_error
+	def testThrowsAtNullState(self):
+		"throws when body has material but NULL state."
+		b=Body()
+		b.mat=Material()
+		b.state=None # → shared_ptr<State>() by boost::python
+		O.bodies.append(b)
+		self.assertRaises(RuntimeError,lambda: O.step())
 	def testMaterialReturnsState(self):
 		"CpmMat returns CpmState when asked for newAssocState"
 		self.assert_(CpmMat().newAssocState().name=='CpmState')

_______________________________________________
Mailing list: https://launchpad.net/~yade-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to