Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorPhil Nash2012-11-16 21:03:59 +0000
committerPhil Nash2012-11-16 21:03:59 +0000
commit08142bfdb69ac8ef90aac1cade378498dd0eca9c (patch)
tree69f05a26fb7232227024a97225a4e151c9b75bc1 /projects
parent0c90ab3572e91a6fc598bbabdb91c5f57c47b69d (diff)
parent88a3f2326573722c248853a8bb1cbbc87364c7d2 (diff)
downloadcatch3-08142bfdb69ac8ef90aac1cade378498dd0eca9c.tar.gz
Fixes const int error seen on some compilers (see #136)
Added a new test to try to highlight issue.
Diffstat (limited to 'projects')
-rw-r--r--projects/SelfTest/ConditionTests.cpp14
-rw-r--r--projects/SelfTest/TestMain.cpp2
-rw-r--r--projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj4
3 files changed, 19 insertions, 1 deletions
diff --git a/projects/SelfTest/ConditionTests.cpp b/projects/SelfTest/ConditionTests.cpp
index 49c22282..e3e3dffe 100644
--- a/projects/SelfTest/ConditionTests.cpp
+++ b/projects/SelfTest/ConditionTests.cpp
@@ -226,6 +226,20 @@ TEST_CASE( "./succeeding/conditions//long_to_unsigned_x",
REQUIRE( long_var == unsigned_long_var );
}
+TEST_CASE( "./succeeding/conditions/const ints to int literal",
+ "comparisons between const int variables" )
+{
+ const unsigned char unsigned_char_var = 1;
+ const unsigned short unsigned_short_var = 1;
+ const unsigned int unsigned_int_var = 1;
+ const unsigned long unsigned_long_var = 1L;
+
+ REQUIRE( unsigned_char_var == 1 );
+ REQUIRE( unsigned_short_var == 1 );
+ REQUIRE( unsigned_int_var == 1 );
+ REQUIRE( unsigned_long_var == 1 );
+}
+
TEST_CASE( "./succeeding/conditions/negative ints",
"Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" )
{
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
index 128ece7c..9677e752 100644
--- a/projects/SelfTest/TestMain.cpp
+++ b/projects/SelfTest/TestMain.cpp
@@ -37,7 +37,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results"
SECTION( "selftest/test counts/succeeding tests",
"Number of 'succeeding' tests is fixed" ) {
Totals totals = runner.runMatching( "./succeeding/*" );
- CHECK( totals.assertions.passed == 289 );
+ CHECK( totals.assertions.passed == 293 );
CHECK( totals.assertions.failed == 0 );
}
diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
index f7ae405d..0376b843 100644
--- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
+++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
@@ -554,8 +554,10 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++98";
CLANG_WARN__DUPLICATE_METHOD_MATCH = NO;
GCC_PREPROCESSOR_DEFINITIONS = "";
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
PRODUCT_NAME = "$(TARGET_NAME)";
WARNING_CFLAGS = (
"-Weverything",
@@ -568,8 +570,10 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++98";
CLANG_WARN__DUPLICATE_METHOD_MATCH = NO;
GCC_PREPROCESSOR_DEFINITIONS = CATCH_CONFIG_USE_ANSI_COLOUR_CODES;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
PRODUCT_NAME = "$(TARGET_NAME)";
WARNING_CFLAGS = (
"-Weverything",