Fix test script to match new code
Fix nullptr bug revealed by bad test script!
This commit is contained in:
parent
83d657985c
commit
73aea7140d
|
@ -150,7 +150,9 @@ void DrawViewSection::onChanged(const App::Property* prop)
|
|||
}
|
||||
if (prop == &SectionOrigin) {
|
||||
App::DocumentObject* base = BaseView.getValue();
|
||||
base->touch();
|
||||
if (base != nullptr) {
|
||||
base->touch();
|
||||
}
|
||||
}
|
||||
}
|
||||
DrawView::onChanged(prop);
|
||||
|
|
|
@ -47,9 +47,13 @@ class TechDrawTestCases(unittest.TestCase):
|
|||
self.Anno = self.Doc.addObject('TechDraw::DrawViewAnnotation','TestAnno')
|
||||
rc = self.Page.addView(self.Anno)
|
||||
self.Sect = self.Doc.addObject('TechDraw::DrawViewSection','Section')
|
||||
rc = self.Page.addView(self.Sect)
|
||||
self.Sect.SectionOrigin = (1.0,1.0,1.0)
|
||||
self.Sect.Source = self.Box
|
||||
self.Sect.Direction = FreeCAD.Vector(-1.0,0.0,0.0)
|
||||
self.Sect.BaseView = self.View
|
||||
self.Sect.SectionDirection = "Right"
|
||||
self.Sect.SectionOrigin = FreeCAD.Vector(1.0,1.0,1.0)
|
||||
self.Sect.SectionNormal = FreeCAD.Vector(-1.0,0.0,0.0)
|
||||
rc = self.Page.addView(self.Sect)
|
||||
self.Doc.recompute()
|
||||
self.failUnless(len(self.Page.Views) == 3)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user