Math3D: fixes

B

Bart Braem

I have been trying to use Math3D (on my Linux system) and I encountered some
problems. It's only fair to post fixes here too, as I can happily use the
library now. I also mailed these patches to the author, I hope he can use
them. Unfortunately there's no rubyforge project and I'm reluctant to set
one up with code coming from someone else.

Here are the patches:

extconf.rb:
The CFLAGS << syntax is deprecated, I did not find any new solutions for it.
On my system the atan function is not in lm (but in the standard gcc library
cmath), so I had to remove that check too. Do note that all tests run fine
now, so this did not harm the workings.

In test.rb:
I had to change the syntax for adding testsuites:
suite << klass.suite if klass < Test::Unit::TestCase

In almost every test I had to rename set_up to setup and tear_down to
teardown, this seems to be old syntax?

In some tests the object.id method is used, I changed it to object.object_id
where Ruby warned me but of course this is nothing serious.

In Bound.tests.rb I had to change [0.to_a] to [[0]] on line 30, I hope
that's equivalent to what was being tested?

In Matrix4.tests.rb I had to do the same on line 32, on line 137 I noticed
you threw IndexErrors instead of Math3d::IndexErrors so I removed Math3d::,
I had the same problem with InvertError.

In Require.tests.rb I fixed the warning that const_defined? should put ( )
around its arguments.

In m3dUnitTest.rb I added a line at the top of the class to avoid running
this empty test: undef_method :default_test (thanks Eric Hodel for the
hint).

In Vector.tests.rb I had larger problems. The instantiation matrix is also
filled with nil objects, but that gives stacktraces when executing. So I
commented out these tests, which feels incorrect... Any suggestions there?
On line 556 I changed .5 into 0.5 in order to make the file run, a trivial
correction of course.

Any comments are welcome!
Bart
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top