MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / Environment

Class Environment

tests/gtest/gtest.h:13485–13500  ·  view source on GitHub ↗

An Environment object is capable of setting up and tearing down an environment. You should subclass this to define your own environment(s). An Environment object does the set-up and tear-down in virtual methods SetUp() and TearDown() instead of the constructor and the destructor, as: 1. You cannot safely throw from a destructor. This is a problem as in some cases Google Test is used where exce

Source from the content-addressed store, hash-verified

13483// 2. You cannot use ASSERT_* directly in a constructor or
13484// destructor.
13485class Environment {
13486 public:
13487 // The d'tor is virtual as we need to subclass Environment.
13488 virtual ~Environment() {}
13489
13490 // Override this to define how to set up the environment.
13491 virtual void SetUp() {}
13492
13493 // Override this to define how to tear down the environment.
13494 virtual void TearDown() {}
13495 private:
13496 // If you see an error about overriding the following function or
13497 // about it being private, you have mis-spelled SetUp() as Setup().
13498 struct Setup_should_be_spelled_SetUp {};
13499 virtual Setup_should_be_spelled_SetUp* Setup() { return nullptr; }
13500};
13501
13502#if GTEST_HAS_EXCEPTIONS
13503

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected