Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

This may be a long shot, but is there a small framework out there anywhere for testing custom bounding classes and other collision objects? (for example between rays, spheres and AABB's)

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

I don't think you'll find any testing frameworks specifically geared towards testing bounding volumes and other geometric primitives or operations, but you can accomplish what you want with unit testing frameworks.

  • UnitTest++ is quite simple and compact. I'd probably recommend that as a starting point.
  • I've also used Google Test as well, which is a bit more complicated but integrates well with Google Mock (which is likely complete overkill for your needs).
  • There's also CppTest, which I've never used, and similarly
  • Boost.Test which is used to help test Boost itself.

Note that you don't need to create strict unit tests to actually employ a unit testing framework; it's perfect acceptable to use them to simply drive some quick automated tests. I would peruse the above, plus whatever else you might find on Google, pick a framework you like working with, and write your tests in that.

When building tests, I find it beneficial to create one test for all classifications of input. This actually tends to be fairly easy when writing tests for mathematical operations -- for example, were I writing a set of tests for the sign() function I would have at least three: one for zero, one for a positive input, and one for a negative input.

It's also helpful to work through the expected test results by hand prior to writing the test. This will both help you reinforce the math yourself and help ensure you use the same conventions used in your actual math routines.

share|improve this answer
    
+1 for a good list of testing frameworks. My personal recommendation would be the CATCH C++ and Objective C testing framework. By far the easiest and fastest (in terms of set-up) framework I have encountered (even better than Google Test in terms of syntax imo... maybe not as feature filled). –  Samaursa Dec 9 '11 at 2:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.