Recently, I’ve been searching for different way to handle data through a game. How to pass in an efficient and beautiful way data to the differents module that can handle said data. And I remember a post I read here. Messaging bus is a nice way to handle data with minimal coupling. So I tried implementing a very basic and simple messaging bus.
Though I honestly believe the implementation and design could be better, it works. And I’m happy with the result. The code is available under zlib/png license so it’s freely usable by anyone.
I recently came upon the need to test some code, but I didn’t want to bother with doing manual testing. Hence, unit testing. It’s magic for real, when you have a nice system to do it. This is where Catch comes in handy. Catch is a very powerful testing tool for C++, that is header only. Now that is magic. No external library. And it’s only one header file. Even better. No? Yes.
Catch is easy, simple, and efficient. For real. I recently decided to test it on my small config class I made for my general utility library. Writing a test case is as easy as this:
That’s it. This test the creation of a config file, and the loading of said config file. Compile, run, done. How hard can it be?
What comes out of this is the simplicity that I can make unit test for pretty much anything now, for all my projects. I intend to try myself at TDD eventually. I believe Catch is going to help me for that.