Renamed files with + in them to be alphanumeric and baselined to roughly r2 or http://unittestpp.googlecode.com/svn/trunk/

This commit is contained in:
Patrick Johnmeyer 2013-01-09 23:33:51 -06:00
parent a3f957c09f
commit 72c2581719
34 changed files with 308 additions and 306 deletions

View file

@ -37,7 +37,7 @@ endif
test_src = src/tests/Main.cpp \
src/tests/TestAssertHandler.cpp \
src/tests/TestChecks.cpp \
src/tests/TestUnitTest++.cpp \
src/tests/TestUnitTestPP.cpp \
src/tests/TestTest.cpp \
src/tests/TestTestResults.cpp \
src/tests/TestTestRunner.cpp \

2
README
View file

@ -7,7 +7,7 @@ the terms of the License contained in the file COPYING distributed
with this package. This license is the same as the MIT/X Consortium
license.
See src/tests/TestUnitTest++.cpp for usage.
See src/tests/TestUnitTestPP.cpp for usage.
Authors:
Noel Llopis (llopis@convexhull.com)

View file

@ -163,7 +163,7 @@
RelativePath=".\src\tests\TestTimeConstraintMacro.cpp">
</File>
<File
RelativePath=".\src\tests\TestUnitTest++.cpp">
RelativePath=".\src\tests\TestUnitTestPP.cpp">
</File>
<File
RelativePath=".\src\tests\TestXmlTestReporter.cpp">

View file

@ -243,7 +243,7 @@
>
</File>
<File
RelativePath=".\src\tests\TestUnitTest++.cpp"
RelativePath=".\src\tests\TestUnitTestPP.cpp"
>
</File>
<File

View file

@ -146,7 +146,7 @@ SOURCE=.\src\tests\TestTimeConstraintMacro.cpp
# End Source File
# Begin Source File
SOURCE=".\src\tests\TestUnitTest++.cpp"
SOURCE=".\src\tests\TestUnitTestPP.cpp"
# End Source File
# Begin Source File

View file

@ -212,7 +212,7 @@
RelativePath=".\src\TimeHelpers.h">
</File>
<File
RelativePath=".\src\UnitTest++.h">
RelativePath=".\src\unittestpp.h">
</File>
<File
RelativePath=".\src\XmlTestReporter.cpp">

View file

@ -301,7 +301,7 @@
>
</File>
<File
RelativePath=".\src\UnitTest++.h"
RelativePath=".\src\unittestpp.h"
>
</File>
<File

View file

@ -237,7 +237,7 @@ SOURCE=.\src\TimeHelpers.h
# End Source File
# Begin Source File
SOURCE=".\src\UnitTest++.h"
SOURCE=".\src\unittestpp.h"
# End Source File
# Begin Source File

View file

@ -31,14 +31,14 @@
<p>You'll probably want to keep the generated library in a shared space in source control, so you can reuse it for multiple test projects. A redistributable package of UnitTest++ would consist of the generated library file, and all of the header files in <code>UnitTest++/src/</code> and its per-platform subfolders. The <code>tests</code> directory only contains the unit tests for the library, and need not be included.</p>
<h2>Using UnitTest++</h2>
<p>The source code for UnitTest++ comes with a full test suite written <em>using</em> UnitTest++. This is a great place to learn techniques for testing. There is one sample .cpp file: <code>UnitTest++/src/tests/TestUnitTest++.cpp</code>. It covers most of UnitTest++'s features in an easy-to-grasp context, so start there if you want a quick overview of typical usage.</p>
<p>The source code for UnitTest++ comes with a full test suite written <em>using</em> UnitTest++. This is a great place to learn techniques for testing. There is one sample .cpp file: <code>UnitTest++/src/tests/TestUnitTestPP.cpp</code>. It covers most of UnitTest++'s features in an easy-to-grasp context, so start there if you want a quick overview of typical usage.</p>
<h3>Getting started</h3>
<p>Listed below is a minimal C++ program to run a failing test through UnitTest++.</p>
<pre>
// test.cpp
#include &lt;UnitTest++.h&gt;
#include &lt;unittestpp.h&gt;
TEST(FailSpectacularly)
{
@ -51,7 +51,7 @@
}
</pre>
<p><code>UnitTest++.h</code> is a facade header for UnitTest++, so including that should get you all features of the library. All classes and free functions are placed in namespace <code>UnitTest</code>, so you need to either qualify their full names (as with <code>RunAllTests()</code> in the example) or add a <code>using namespace UnitTest;</code> statement in your .cpp files. Note that any mention of UnitTest++ functions and classes in this document assume that the <code>UnitTest</code> namespace has been opened.</p>
<p><code>unittestpp.h</code> is a facade header for UnitTest++, so including that should get you all features of the library. All classes and free functions are placed in namespace <code>UnitTest</code>, so you need to either qualify their full names (as with <code>RunAllTests()</code> in the example) or add a <code>using namespace UnitTest;</code> statement in your .cpp files. Note that any mention of UnitTest++ functions and classes in this document assume that the <code>UnitTest</code> namespace has been opened.</p>
<p>Compiling and linking this program with UnitTest++'s static library into an executable, and running it, will produce the following output (details may vary):</p>

View file

@ -22,4 +22,8 @@ DeferredTestResult::DeferredTestResult(char const* suite, char const* test)
{
}
DeferredTestResult::~DeferredTestResult()
{
}
}

View file

@ -34,7 +34,7 @@ TestRunner::~TestRunner()
int TestRunner::Finish() const
{
float const secondsElapsed = m_timer->GetTimeInMs() / 1000.0f;
float const secondsElapsed = static_cast<float>(m_timer->GetTimeInMs() / 1000.0);
m_reporter->ReportSummary(m_result->GetTotalTestCount(),
m_result->GetFailedTestCount(),
m_result->GetFailureCount(),
@ -60,7 +60,7 @@ void TestRunner::RunTest(TestResults* const result, Test* const curTest, int con
curTest->Run();
int const testTimeInMs = testTimer.GetTimeInMs();
double const testTimeInMs = testTimer.GetTimeInMs();
if (maxTestTimeInMs > 0 && testTimeInMs > maxTestTimeInMs && !curTest->m_timeConstraintExempt)
{
MemoryOutStream stream;
@ -70,7 +70,7 @@ void TestRunner::RunTest(TestResults* const result, Test* const curTest, int con
result->OnTestFailure(curTest->m_details, stream.GetText());
}
result->OnTestFinish(curTest->m_details, testTimeInMs/1000.0f);
result->OnTestFinish(curTest->m_details, static_cast<float>(testTimeInMs/1000.0));
}
}

View file

@ -1,14 +1,12 @@
#ifndef UNITTEST_TESTSUITE_H
#define UNITTEST_TESTSUITE_H
namespace UnitTestSuite {
namespace UnitTestSuite
{
inline char const* GetSuiteName ()
{
return "DefaultSuite";
}
}
#endif

View file

@ -15,7 +15,7 @@ TimeConstraint::TimeConstraint(int ms, TestDetails const& details)
TimeConstraint::~TimeConstraint()
{
int const totalTimeInMs = m_timer.GetTimeInMs();
double const totalTimeInMs = m_timer.GetTimeInMs();
if (totalTimeInMs > m_maxMs)
{
MemoryOutStream stream;

View file

@ -7,7 +7,7 @@ Timer::Timer()
: m_threadHandle(::GetCurrentThread())
, m_startTime(0)
{
#if defined(_MSC_VER) && (_MSC_VER == 1200) // VC6 doesn't have DWORD_PTR?
#if defined(_MSC_VER) && (_MSC_VER == 1200) // VC6 doesn't have DWORD_PTR
typedef unsigned long DWORD_PTR;
#endif

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../TestReporterStdout.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../AssertException.h"
#include "../ReportAssert.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../CurrentTest.h"
#include "RecordingReporter.h"
#include "ScopedCurrentTest.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "RecordingReporter.h"
using namespace UnitTest;

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../CurrentTest.h"
#include "ScopedCurrentTest.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../DeferredTestReporter.h"
#include "../Config.h"
#include <cstring>

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../MemoryOutStream.h"
#include <cstring>

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../TestReporter.h"
#include "../TimeHelpers.h"
#include "ScopedCurrentTest.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../TestList.h"
using namespace UnitTest;

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../TestMacros.h"
#include "../TestList.h"
#include "../TestResults.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../TestResults.h"
#include "RecordingReporter.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "RecordingReporter.h"
#include "../ReportAssert.h"
#include "../TestList.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
// We're really testing if it's possible to use the same suite in two files
// to compile and link successfuly (TestTestSuite.cpp has suite with the same name)

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../TestResults.h"
#include "../TimeHelpers.h"
#include "RecordingReporter.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../TimeHelpers.h"
#include "RecordingReporter.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../ReportAssert.h"
#include "ScopedCurrentTest.h"

View file

@ -1,4 +1,4 @@
#include "../UnitTest++.h"
#include "../unittestpp.h"
#include "../XmlTestReporter.h"
#include <sstream>