Archive For The “C/C++” Category

Boost: How do I write a unit test for a signal?

Today, while writing some unit tests, I encountered a challenge. The user story was that, when a Person’s details are updated, the display should be updated to reflect the changes. I’d implemented this feature using a signal on the person class that will be called whenever any details are updated: This is a fairly standard […]

Read more »

Using the Boost Unit Test Framework with Xcode 3

Warning: this article is no longer being actively updated and parts of it are probably out of date. Proceed with caution! Update (Nov 2009): the custom log formatter in this article is now part of the Boost Unit Test Library, via the compiler_log_formatter. So you don’t need to roll your own anymore! (Thanks Sean for […]

Read more »

St9exception with libstdc++

Here’s something I encountered today when writing some C++: When run, this code will write “error: St9exception”, instead of “some message” to stdout. “St9exception” comes from libstdc++, in which the default value returned by std::exception::what() is the mangled symbol name. The mistake was that I was catching the exception by value, not by reference. (Too […]

Read more »

Improved error reporting patch for BNC 2.9.4

BNC 2.9.4 is a simple open-source IRC proxy. Their website is down at the moment, but you can see a cached version here. I prefer it over more feature-rich proxies like psyBNC because it’s one-server-per-client model is a natural fit for mIRC‘s multi-server support. It also makes things a lot easier if you prefer to […]

Read more »

Generating a Makefile from Xcode

Almost all open source software projects I have encountered rely on GNU Make as a build tool. Make is a tool available on many platforms (most notably Linux and UNIX) that manages the compilation and installation of software programs. A Makefile defines the location of source files and steps required to compile and link targets […]

Read more »