Tuesday, June 30, 2009

Bug fixes and unit testing

NaroCAD gets shinier as it fixes in those two days small annoyances:
- scripting tab editing area gets wrong layout
- the changing name of a shape will not update the object list
- the default color should match the object's color, not a non initialized one (displayed as white)
- sourceforge bug reporter web page has changed the page form so the crashes were getting an 403 error (access forbidden)
- a crash may happen when Ellipse have zero size minor radius at design time
- NaroStarter will firstly try to find an existing OpenCascade installation. If it does not, it will use it's own bundled OpenCascade distribution. This is user friendly way. Also, in SVN exists an environment installer that brings to you the "native" dlls of OpenCascade for running NaroCAD.

NaroCAD has support to write unit tests (based on NUnit), but in fact many unit tests were never written because NaroCAD needs to create an OpenCascade view before adding even a simple line. Thus being said, makes unit testing in that area to be a non trivial task, also when it was an simpler issue like parametric modeling event propagation.

Right now there was reviewed the shape creation code to not depend on OpenCascade view and you can create your own test that works faster and well. Also, the tests are based on Document class, means that if you have a complex scene that you know that it crash NaroCAD, supposedly after creating a 3 extrude shapes, when you add an ellipse on top of them it will fail, you can design it in NaroCAD. Save it. You can load that three extrudes and make in your unit test to add the ellipse only.

So hopefully if we encounter crashes, we can create an unit test and add to NaroCAD test suite to not happen again.

At the end of the week I will post on SourceForge NaroCAD 1.0.1 that will include all those fixes, so you will be able to get away those small annoyances. It wil replace the 1.0 version. I pick the end of week to have time to not add regressions as I do those fixes.

No comments: