The use of a local static variable in a non-static class method is
only instantiated once and used by all instances of that object.
In core::test::Harness::client() we were statically creating the
result (client) with the current instances' display_ member. Hence,
if a second core::test::Harness instance was created using a
different display_, the client() return value for the second instance
would be that of the first instance (i.e. it uses the first instances'
display_). This is not what we'd expect/want as an API consumer.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Harness::Harness()
: test::Harness::Harness()
, display_()
+ , client_(display_)
{
return;
}
const test::Client& Harness::client() const
{
- static const test::Client c(display_);
- return c;
+ return client_;
}
class SimpleTest : public Harness
void runStep(TestStep step) const;
Display display_;
+ Client client_;
};
#define WFITS_CORE_HARNESS_TEST_CASE(HarnessClass) \