Skip to content

Commit

Permalink
revision for cpp test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TomyYamy committed Mar 28, 2022
1 parent c920445 commit 8ad3610
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions rtamt/operation/stl/discrete_time/online/cpp/ast_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ def visitXor(self, node, *args, **kwargs):
self.online_operator_dict[node.name] = XorOperation()

def visitEventually(self, node, *args, **kwargs):
self.visitChildren(node, *args, **kwargs)
self.online_operator_dict[node.name] = EventuallyOperation()
#self.visitChildren(node, *args, **kwargs)
#self.online_operator_dict[node.name] = EventuallyOperation()
raise STLNotImplementedException('Eventually operator is not implemented in the STL online monitor.')

def visitAlways(self, node, *args, **kwargs):
self.visitChildren(node, *args, **kwargs)
self.online_operator_dict[node.name] = AlwaysOperation()
#self.visitChildren(node, *args, **kwargs)
#self.online_operator_dict[node.name] = AlwaysOperation()
raise STLNotImplementedException('Always operator is not implemented in the STL online monitor.')

def visitUntil(self, node, *args, **kwargs):
raise STLNotImplementedException('Until operator is not implemented in the STL online monitor.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ def test_division(self):
out4 = spec.update(3, [('req', self.left4), ('gnt', self.right4)])
out5 = spec.update(4, [('req', self.left5), ('gnt', self.right5)])

self.assertEqual(out1, 100 / 20, "input 1")
self.assertEqual(out2, -1 / -2, "input 2")
self.assertEqual(out3, -2 / 10, "input 3")
self.assertEqual(out4, 5 / 4, "input 4")
self.assertEqual(out5, -1 / -1, "input 5")
self.assertEqual(out1, 100.0 / 20.0, "input 1")
self.assertEqual(out2, -1.0 / -2.0, "input 2")
self.assertEqual(out3, -2.0 / 10, "input 3")
self.assertEqual(out4, 5.0 / 4.0, "input 4")
self.assertEqual(out5, -1.0 / -1.0, "input 5")

def test_abs(self):
spec = rtamt.StlDiscreteTimeOnlineSpecificationCpp()
Expand Down Expand Up @@ -334,7 +334,7 @@ def test_always_without_pastify(self):

spec.parse()

self.assertRaises(rtamt.LTLNotImplementedException, spec.update, 0, [('req', self.left1)])
self.assertRaises(rtamt.STLNotImplementedException, spec.update, 0, [('req', self.left1)])

def test_always_with_pastify(self):
spec = rtamt.StlDiscreteTimeOnlineSpecificationCpp()
Expand Down

0 comments on commit 8ad3610

Please sign in to comment.