robincornelius / libedssharp

A CanOpen EDS editor and library in C# with CanOpenNode export for Object Dictionary
GNU General Public License v3.0
227 stars 134 forks source link

Fix for a bug in CanOpenNodeExporter_V4 #264

Closed DylanRobertBennett closed 3 years ago

DylanRobertBennett commented 3 years ago

Subject: Added a test file for CanOpenNodeExporter_V4.

The method Make_cname in CanOpenNodeExporter_V4 was failing and no tests existed. The test created was replicated from the method make_cname in CanOpenNodeExporter. To create the test CanOpenNodeExporter_V4.Make_cname was changed from private to protected.

Subject: Added string to test that caused an exception in Make_cname().

The string that failed when running 'Export CanOpenNode...' in the EDSEditor was added to the test for CanOpenNodeExporter_V4.Make_cname. Other strings were also added that tests conditions that Make_cname should handle. The exception was caused by an array out-of-bounds error.

Subject: Fixed a bug in the CanOpenNodeExporter_V4.Make_cname.

The method would fail on a array out-of-bounds exception. This was do to and empty string that was added to the tokens list. It was fixed by removing all empty strings from the tokens list as was done in CanOpenNodeExporter.make_cname.

The conditions in the test for this method all failed. The method was modified to pass the conditions in the test.