Skip to content

Commit

Permalink
v1.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed May 16, 2017
1 parent 589c400 commit 3dcc923
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Build Status](https://travis-ci.org/philsquared/Catch.svg?branch=master)](https://travis-ci.org/philsquared/Catch)
[![Build status](https://ci.appveyor.com/api/projects/status/hrtk60hv6tw6fght/branch/master?svg=true)](https://ci.appveyor.com/project/philsquared/catch/branch/master)

<a href="https://github.com/philsquared/Catch/releases/download/v1.9.3/catch.hpp">The latest, single header, version can be downloaded directly using this link</a>
<a href="https://github.com/philsquared/Catch/releases/download/v1.9.4/catch.hpp">The latest, single header, version can be downloaded directly using this link</a>

## What's the Catch?

Expand Down
10 changes: 10 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 1.9.4

### Fixes
* `CATCH_FAIL` macro no longer causes compilation error without variadic macro support
* `INFO` messages are no longer cleared after being reported once

### Improvements and minor changes
* Catch now uses `wmain` when compiled under Windows and `UNICODE` is defined.
* Note that Catch still officially supports only ASCII

# 1.9.3

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion include/internal/catch_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace Catch {
}

inline Version libraryVersion() {
static Version version( 1, 9, 3, "", 0 );
static Version version( 1, 9, 4, "", 0 );
return version;
}

Expand Down
47 changes: 40 additions & 7 deletions single_include/catch.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catch v1.9.3
* Generated: 2017-04-25 14:16:29.434734
* Catch v1.9.4
* Generated: 2017-05-16 13:51:55.506519
* ----------------------------------------------------------
* This file has been merged from multiple headers. Please don't edit it directly
* Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
Expand Down Expand Up @@ -2272,7 +2272,7 @@ namespace Catch {
INTERNAL_CATCH_REACT( __catchResult ) \
} while( Catch::alwaysFalse() )
#else
#define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \
#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, log ) \
do { \
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
__catchResult << log + ::Catch::StreamEndStop(); \
Expand Down Expand Up @@ -6642,8 +6642,9 @@ namespace Catch {
m_totals.assertions.failed++;
}

if( m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ) )
m_messages.clear();
// We have no use for the return value (whether messages should be cleared), because messages were made scoped
// and should be let to clear themselves out.
static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)));

// Reset working state
m_lastAssertionInfo = AssertionInfo( std::string(), m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition );
Expand Down Expand Up @@ -7052,6 +7053,32 @@ namespace Catch {
return returnCode;
}

#if defined(WIN32) && defined(UNICODE)
int run( int argc, wchar_t const* const* const argv ) {

char **utf8Argv = new char *[ argc ];

for ( int i = 0; i < argc; ++i ) {
int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, NULL, 0, NULL, NULL );

utf8Argv[ i ] = new char[ bufSize ];

WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, NULL, NULL );
}

int returnCode = applyCommandLine( argc, utf8Argv );
if( returnCode == 0 )
returnCode = run();

for ( int i = 0; i < argc; ++i )
delete [] utf8Argv[ i ];

delete [] utf8Argv;

return returnCode;
}
#endif

int run() {
if( m_configData.showHelp )
return 0;
Expand Down Expand Up @@ -8282,7 +8309,7 @@ namespace Catch {
}

inline Version libraryVersion() {
static Version version( 1, 9, 3, "", 0 );
static Version version( 1, 9, 4, "", 0 );
return version;
}

Expand Down Expand Up @@ -11268,8 +11295,14 @@ namespace Catch {

#ifndef __OBJC__

#if defined(WIN32) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
// Standard C/C++ Win32 Unicode wmain entry point
extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
#else
// Standard C/C++ main entry point
int main (int argc, char * argv[]) {
#endif

int result = Catch::Session().run( argc, argv );
return ( result < 0xff ? result : 0xff );
}
Expand Down Expand Up @@ -11349,7 +11382,7 @@ int main (int argc, char * const argv[]) {
#define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
#define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
#define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
#define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", __VA_ARGS__ )
#define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
#define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
#define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
#else
Expand Down

0 comments on commit 3dcc923

Please sign in to comment.