Skip to content

Commit

Permalink
Class name refactored to reflect new purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
codemercenary committed Aug 2, 2014
1 parent abb0cf3 commit 0feec37
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
/// <summary>
/// General purpose exception filter, used for tracking exceptions thrown from unit test CoreThreads
/// </summary>
class EnclosedContextExceptionFilter:
class AutowiringEnclosureExceptionFilter:
public ContextMember,
public ExceptionFilter
{
public:
EnclosedContextExceptionFilter(void) :
ContextMember("EnclosedContextExceptionFilter"),
AutowiringEnclosureExceptionFilter(void) :
ContextMember("AutowiringEnclosureExceptionFilter"),
m_excepted(false)
{}

Expand Down Expand Up @@ -44,7 +44,7 @@ class EnclosedContextExceptionFilter:
/// tests complete in a timely fashion. If a longer stop duration is desired, you must provide a
/// destructor which performs teardown in a different way.
/// </remarks>
class EnclosedContextTestBase:
class AutowiringEnclosure:
public testing::EmptyTestEventListener
{
private:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "EnclosedContextTestBase.h"
#include "AutowiringEnclosure.h"

struct TestInfoProxy {
TestInfoProxy(const testing::TestInfo& info) :
Expand All @@ -9,25 +9,25 @@ struct TestInfoProxy {
const testing::TestInfo& m_info;
};

void EnclosedContextTestBase::OnTestStart(const testing::TestInfo& info) {
AutoRequired<EnclosedContextExceptionFilter> filter;
void AutowiringEnclosure::OnTestStart(const testing::TestInfo& info) {
AutoRequired<AutowiringEnclosureExceptionFilter> filter;

// The context proper. This is automatically assigned as the current
// context when SetUp is invoked.
AutoCreateContext create;
create->Construct<TestInfoProxy>(info);

// Add exception filter in this context:
create->Inject<EnclosedContextExceptionFilter>();
create->Inject<AutowiringEnclosureExceptionFilter>();

// Now make it current and let the test run:
create->SetCurrent();
}

void EnclosedContextTestBase::OnTestEnd(const testing::TestInfo& info) {
void AutowiringEnclosure::OnTestEnd(const testing::TestInfo& info) {
// Verify we can grab the test case back out and that the pointer is correct:
Autowired<TestInfoProxy> ti;
Autowired<EnclosedContextExceptionFilter> ecef;
Autowired<AutowiringEnclosureExceptionFilter> ecef;
auto ctxt = ecef ? ecef->GetContext() : nullptr;

// Unconditionally reset the global context as the current context
Expand Down
5 changes: 3 additions & 2 deletions src/autotesting/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(AutoTesting_SOURCES
EnclosedContextTestBase.h
EnclosedContextTestBase.cpp
AutowiringEnclosure.h
AutowiringEnclosure.cpp
gtest-all-guard.cpp
)

rewrite_header_paths(AutoTesting_SOURCES)
Expand Down
1 change: 0 additions & 1 deletion src/autowiring/test/ContextEnumeratorTest.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#pragma once
#include "EnclosedContextTestBase.hpp"

class ContextEnumeratorTest:
public testing::Test
Expand Down

0 comments on commit 0feec37

Please sign in to comment.