Unit Testing Legacy C

Here are my slides from the lightning talk I gave at the ACCU 2011 Conference.

Related links:

2 Comments

Filed under Uncategorized

2 responses to “Unit Testing Legacy C

  1. Fausto

    I liked the fff framework…but it does not resolve one of my bigest problens: how to reset the state of static data….without getting the “#include “*.c”” in my test case…

    • meekrosoft

      The only way around the static data issue is to use an init function to reset the static before each test. Either you #include the .c file and add the reset code in you test file, or you have to provide it in the production code. It is all down to personal preference where the the init function goes, but for space-sensitive embedded systems it is best to put it in the test code so you don’t get the overhead in production. Hope that helps!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s