title: Boost Test Fixture object clearing between tests
body: <p>I am having a issue with boost unit testing.  Basically I create a fixture which is part of a suite to unit test a Resource cache.  My main issue is between tests the Resource cache is becoming empty.  So the first test that tests the cache passes then the second one will fail because the data the first test inserted into the cache is no longer there.  To solve this I had to re insert the data for the second test.  Is this intended or is it something I am doing wrong?  Here is the code.  The last 2 tests is where the issue lies.</p>
  
  <pre><code>
  #include "UnitTestIncludes.hpp"
  #include "ResourceCache.hpp"
  #include &#60SFML/Graphics.hpp&#62
  
  struct ResourceCacheFixture
  {
      ResourceCacheFixture()
      {
          BOOST_TEST_MESSAGE("Setup Fixture...");
          key = "graysqr";
          imgpath = "../images/graysqr.png";
      }
  
      ResourceCache&#60sf::Image, ImageGenerator&#62 imgCache;
      std::string key;
      std::string imgpath;
  };
  
  // Start of Test Suite
  
  BOOST_FIXTURE_TEST_SUITE(ResourceCacheTestSuite, ResourceCacheFixture)
  
  // Start of tests
  
  BOOST_AUTO_TEST_CASE(ImageGeneratorTest)
  {
      ImageGenerator imgGen;
      BOOST_REQUIRE(imgGen("../images/graysqr.png"));
  
  }
  
  BOOST_AUTO_TEST_CASE(FontGeneratorTest)
  {
      FontGenerator fntGen;
      BOOST_REQUIRE(fntGen("../fonts/arial.ttf"));
  }
  
  // This is where the issue is.  The data inserted in this test is lost for when I do
  // the GetResourceTest.  It is fixed here by reinserting the data.
  BOOST_AUTO_TEST_CASE(LoadResourceTest)
  {
      bool result = imgCache.load_resource(key, imgpath);
      BOOST_REQUIRE(result);
  }
  
  BOOST_AUTO_TEST_CASE(GetResourceTest)
  {
      imgCache.load_resource(key, imgpath);
      BOOST_REQUIRE(imgCache.get_resource(key));
  }
  
  // End of Tests
  
  // End of Test Suite
  BOOST_AUTO_TEST_SUITE_END()</code></pre>