Skip to content

Commit

Permalink
Merge pull request #26 from leapmotion/ref-testheaders
Browse files Browse the repository at this point in the history
Eliminating superfluous header files in unit tests
  • Loading branch information
gtremper committed Aug 4, 2014
2 parents c3b7e62 + c8650e0 commit 83d2570
Show file tree
Hide file tree
Showing 72 changed files with 158 additions and 310 deletions.
5 changes: 4 additions & 1 deletion src/autowiring/test/AnySharedPointerTest.cpp
@@ -1,10 +1,13 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "AnySharedPointerTest.hpp"
#include "TestFixtures/SimpleObject.hpp"
#include <autowiring/AnySharedPointer.h>
#include <autowiring/autowiring.h>

class AnySharedPointerTest:
public testing::Test
{};

class MyUnusedClass {};

template<>
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/AnySharedPointerTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/AutoAnchorTest.cpp
@@ -1,8 +1,11 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "AutoAnchorTest.hpp"
#include "TestFixtures/SimpleObject.hpp"

class AutoAnchorTest:
public testing::Test
{};

struct AnchorsNothing:
AutoAnchor<>
{};
Expand Down
7 changes: 0 additions & 7 deletions src/autowiring/test/AutoAnchorTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/AutoFilterTest.cpp
@@ -1,12 +1,15 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "AutoFilterTest.hpp"
#include "TestFixtures/Decoration.hpp"
#include <autowiring/AutoPacket.h>
#include <autowiring/AutoPacketFactory.h>
#include <autowiring/NewAutoFilter.h>
#include THREAD_HEADER

class AutoFilterTest:
public testing::Test
{};

TEST_F(AutoFilterTest, VerifyDescendentAwareness) {
AutoCurrentContext()->Initiate();

Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/AutoFilterTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/AutoInjectableTest.cpp
@@ -1,9 +1,12 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "AutoInjectableTest.hpp"
#include "TestFixtures/SimpleObject.hpp"
#include <autowiring/AutoInjectable.h>

class AutoInjectableTest:
public testing::Test
{};

TEST_F(AutoInjectableTest, VerifySimpleInjection) {
auto injector = MakeInjectable<SimpleObject>();
injector();
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/AutoInjectableTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/AutoPacketFactoryTest.cpp
@@ -1,8 +1,11 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "AutoPacketFactoryTest.hpp"
#include <autowiring/CoreThread.h>

class AutoPacketFactoryTest:
public testing::Test
{};

TEST_F(AutoPacketFactoryTest, VerifyNoIssueWhileNotStarted) {
AutoRequired<AutoPacketFactory> factory;
ASSERT_THROW(factory->NewPacket(), autowiring_error) << "Issuing a packet in a context that has not yet been started should throw an exception";
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/AutoPacketFactoryTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/AutowiringTest.cpp
@@ -1,6 +1,5 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "AutowiringTest.hpp"
#include "gtest-all-guard.h"
#include "TestFixtures/SimpleObject.hpp"
#include "TestFixtures/SimpleReceiver.hpp"
Expand All @@ -11,6 +10,10 @@ int main(int argc, const char* argv []) {
return autotesting_main(argc, argv);
}

class AutowiringTest:
public testing::Test
{};

TEST_F(AutowiringTest, VerifyAutowiredFast) {
// Add an object:
AutoCurrentContext()->Inject<SimpleObject>();
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/AutowiringTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/AutowiringUtilitiesTest.cpp
@@ -1,12 +1,15 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "AutowiringUtilitiesTest.hpp"
#include <autowiring/Autowired.h>
#include <autowiring/BasicThread.h>
#include <autowiring/CoreThread.h>
#include <autowiring/thread_specific_ptr.h>
#include THREAD_HEADER

class AutowiringUtilitiesTest:
public testing::Test
{};

static autowiring::thread_specific_ptr<int> s_thread_specific_int;

class Thread1:
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/AutowiringUtilitiesTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/BasicThreadTest.cpp
@@ -1,8 +1,11 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "BasicThreadTest.hpp"
#include <autowiring/BasicThread.h>

class BasicThreadTest:
public testing::Test
{};

class SpinsAndThenQuits:
public BasicThread
{
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/BasicThreadTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/BoltTest.cpp
@@ -1,13 +1,16 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "BoltTest.hpp"
#include <autowiring/Autowired.h>
#include <autowiring/Bolt.h>
#include <autowiring/ContextCreator.h>
#include "TestFixtures/SimpleObject.hpp"
#include <string>
#include <iostream>

class BoltTest:
public testing::Test
{};

struct Pipeline {};
struct OtherContext {};

Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/BoltTest.hpp

This file was deleted.

40 changes: 2 additions & 38 deletions src/autowiring/test/CMakeLists.txt
@@ -1,77 +1,42 @@
set(AutowiringTest_SRCS
AnySharedPointerTest.hpp
AnySharedPointerTest.cpp
AutoAnchorTest.hpp
AutoAnchorTest.cpp
AutoFilterTest.hpp
AutoFilterTest.cpp
AutoInjectableTest.hpp
AutoInjectableTest.cpp
AutoPacketFactoryTest.hpp
AutoPacketFactoryTest.cpp
AutowiringTest.hpp
AutowiringTest.cpp
AutowiringUtilitiesTest.hpp
AutowiringUtilitiesTest.cpp
BasicThreadTest.hpp
BasicThreadTest.cpp
CoreContextTest.hpp
BoltTest.cpp
CoreContextTest.cpp
ContextCleanupTest.hpp
CoreJobTest.cpp
ContextCleanupTest.cpp
ContextEnumeratorTest.hpp
ContextEnumeratorTest.cpp
ContextMapTest.hpp
ContextMapTest.cpp
ContextMemberTest.hpp
ContextMemberTest.cpp
CoreThreadTest.hpp
CoreThreadTest.cpp
BoltTest.hpp
BoltTest.cpp
ContextCreatorTest.hpp
ContextCreatorTest.cpp
CurrentContextPusherTest.hpp
CurrentContextPusherTest.cpp
DecoratorTest.hpp
DecoratorTest.cpp
DispatchQueueTest.hpp
DispatchQueueTest.cpp
DtorCorrectnessTest.hpp
DtorCorrectnessTest.cpp
ExceptionFilterTest.hpp
ExceptionFilterTest.cpp
EventReceiverTest.hpp
EventReceiverTest.cpp
FactoryTest.hpp
FactoryTest.cpp
GlobalInitTest.hpp
GlobalInitTest.cpp
GuardObjectTest.hpp
GuardObjectTest.cpp
InterlockedRoutinesTest.hpp
InterlockedRoutinesTest.cpp
MarshalingTest.hpp
MarshalingTest.cpp
MultiInheritTest.hpp
MultiInheritTest.cpp
ObjectPoolTest.hpp
ObjectPoolTest.cpp
PeerContextTest.hpp
PeerContextTest.cpp
PostConstructTest.hpp
PostConstructTest.cpp
SelfSelectingFixtureTest.hpp
SelfSelectingFixtureTest.cpp
TeardownNotifierTest.hpp
TeardownNotifierTest.cpp
CoreJobTest.hpp
CoreJobTest.cpp
TypeRegistryTest.hpp
TypeRegistryTest.cpp
ScopeTest.hpp
ScopeTest.cpp
SnoopTest.hpp
SnoopTest.cpp
TestFixtures/custom_exception.hpp
TestFixtures/ExitRaceThreaded.hpp
Expand All @@ -82,7 +47,6 @@ set(AutowiringTest_SRCS
TestFixtures/ThrowsWhenFired.hpp
TestFixtures/ThrowsWhenRun.hpp
TestFixtures/MultiInherit.hpp
UuidTest.hpp
UuidTest.cpp
)

Expand Down
5 changes: 4 additions & 1 deletion src/autowiring/test/ContextCleanupTest.cpp
@@ -1,12 +1,15 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "ContextCleanupTest.hpp"
#include "TestFixtures/SimpleObject.hpp"
#include "TestFixtures/SimpleThreaded.hpp"
#include <autowiring/Autowired.h>
#include <autowiring/CoreContext.h>
#include THREAD_HEADER

class ContextCleanupTest:
public testing::Test
{};

TEST_F(ContextCleanupTest, ValidateTeardownOrder) {
class WeakPtrChecker {
public:
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/ContextCleanupTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/ContextCreatorTest.cpp
@@ -1,11 +1,14 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "ContextCreatorTest.hpp"
#include <autowiring/ContextCreator.h>
#include <autowiring/CoreContext.h>
#include <autowiring/CoreThread.h>
#include <string>

class ContextCreatorTest:
public testing::Test
{};

struct EvictionContext {};

class Creator:
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/ContextCreatorTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/ContextEnumeratorTest.cpp
@@ -1,9 +1,12 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "ContextEnumeratorTest.hpp"
#include <autowiring/ContextEnumerator.h>
#include MEMORY_HEADER

class ContextEnumeratorTest:
public testing::Test
{};

TEST_F(ContextEnumeratorTest, DegenerateEnumeration) {
size_t ct = 0;
for(const auto& cur : ContextEnumerator(std::shared_ptr<CoreContext>(nullptr))) {
Expand Down
6 changes: 0 additions & 6 deletions src/autowiring/test/ContextEnumeratorTest.hpp

This file was deleted.

6 changes: 5 additions & 1 deletion src/autowiring/test/ContextMapTest.cpp
@@ -1,13 +1,17 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "ContextMapTest.hpp"
#include "TestFixtures/ExitRaceThreaded.hpp"
#include "TestFixtures/SimpleThreaded.hpp"
#include <autowiring/Autowired.h>
#include <autowiring/ContextMap.h>
#include <string>
#include THREAD_HEADER

class ContextMapTest:
public testing::Test
{
};

using namespace std;

TEST_F(ContextMapTest, VerifySimple) {
Expand Down
8 changes: 0 additions & 8 deletions src/autowiring/test/ContextMapTest.hpp

This file was deleted.

5 changes: 4 additions & 1 deletion src/autowiring/test/ContextMemberTest.cpp
@@ -1,9 +1,12 @@
// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#include "stdafx.h"
#include "ContextMemberTest.hpp"
#include "TestFixtures/SimpleObject.hpp"
#include "TestFixtures/SimpleThreaded.hpp"

class ContextMemberTest:
public testing::Test
{};

class IsAContextMember:
public ContextMember
{};
Expand Down

0 comments on commit 83d2570

Please sign in to comment.