From 50222c5ba392bcce2e44df0a298e58fb2c549241 Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Tue, 28 Jan 2025 15:00:57 -0700 Subject: [PATCH 1/6] Updating github ci --- .github/workflows/ContinuousIntegration.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ContinuousIntegration.yml b/.github/workflows/ContinuousIntegration.yml index 67c7c1a..b3d8ffc 100644 --- a/.github/workflows/ContinuousIntegration.yml +++ b/.github/workflows/ContinuousIntegration.yml @@ -11,12 +11,15 @@ on: pull_request: branches: 'main' +# ubuntu-22.04 is x64 +# macos-13 is intel +# macos-14 is arm64 (M1) jobs: build: runs-on: ${{matrix.os}} strategy: matrix: - os: [ ubuntu-22.04, macos-13 ] + os: [ ubuntu-22.04, macos-13, macos-14 ] cxx: [ clang++, g++-12 ] build_type: [ Debug, Release ] From e1359f1d2a5044a121e6ac7bd3ad183ee3356988 Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Tue, 28 Jan 2025 15:01:26 -0700 Subject: [PATCH 2/6] Preparing for linux arm64 runners on GitHub --- src/tools/disco/BaseField/test/BaseField.test.cpp | 2 +- .../disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp | 2 +- .../disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp | 2 +- src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp | 2 +- src/tools/disco/Integer/test/Integer.test.cpp | 2 +- src/tools/disco/Real/test/Real.test.cpp | 2 +- src/tools/disco/functions/test/functions.test.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/disco/BaseField/test/BaseField.test.cpp b/src/tools/disco/BaseField/test/BaseField.test.cpp index e1570e9..2c52df7 100644 --- a/src/tools/disco/BaseField/test/BaseField.test.cpp +++ b/src/tools/disco/BaseField/test/BaseField.test.cpp @@ -19,7 +19,7 @@ class TestBaseField : protected BaseField { SCENARIO( "BaseField" ) { std::string string = " a\t\n\r\n\f"; - string += char{ std::char_traits::eof() }; + string += std::char_traits::eof(); auto iter = string.begin(); unsigned int position = 0; diff --git a/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp b/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp index b5fb0df..d392013 100644 --- a/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp +++ b/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp @@ -21,7 +21,7 @@ class TestBaseFixedWidthField : protected BaseFixedWidthField< Width > { SCENARIO( "BaseFixedWidthField" ) { std::string string = " a\t\n\r\n\f"; - string += char{ std::char_traits::eof() }; + string += std::char_traits::eof(); auto iter = string.begin(); unsigned int position = 0; diff --git a/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp b/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp index 05a6892..9e79981 100644 --- a/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp +++ b/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp @@ -105,7 +105,7 @@ SCENARIO( "Integer" ) { CHECK( iter == end - 1 ); string = " +123"; - string += char{ std::char_traits::eof() }; + string += std::char_traits::eof(); iter = string.begin(); end = string.end(); CHECK( 123 == FreeFormatInteger::read< int >( iter, end ) ); diff --git a/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp b/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp index 39bfc9a..e1b4ddf 100644 --- a/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp +++ b/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp @@ -215,7 +215,7 @@ SCENARIO( "Integer" ) { CHECK( iter == end - 1 ); string = " +123"; - string += char{ std::char_traits::eof() }; + string += std::char_traits::eof(); iter = string.begin(); end = string.end(); CHECK_THAT( 123, WithinRel( FreeFormatReal::read< double >( iter, end ) ) ); diff --git a/src/tools/disco/Integer/test/Integer.test.cpp b/src/tools/disco/Integer/test/Integer.test.cpp index 0ab4463..de4ddf0 100644 --- a/src/tools/disco/Integer/test/Integer.test.cpp +++ b/src/tools/disco/Integer/test/Integer.test.cpp @@ -86,7 +86,7 @@ SCENARIO( "Integer" ) { CHECK( begin == end - 1 ); string = " +123"; - string += char{ std::char_traits::eof() }; + string += std::char_traits::eof(); begin = string.begin(); end = string.end(); CHECK( 123 == Integer< 10 >::read< int >( begin, end ) ); diff --git a/src/tools/disco/Real/test/Real.test.cpp b/src/tools/disco/Real/test/Real.test.cpp index cc1ed6f..4e50e42 100644 --- a/src/tools/disco/Real/test/Real.test.cpp +++ b/src/tools/disco/Real/test/Real.test.cpp @@ -220,7 +220,7 @@ SCENARIO( "Real" ) { CHECK( begin == end - 1 ); string = " +123"; - string += char{ std::char_traits::eof() }; + string += std::char_traits::eof(); begin = string.begin(); end = string.end(); CHECK_THAT( 123, WithinRel( Real< 10 >::read< double >( begin, end ) ) ); diff --git a/src/tools/disco/functions/test/functions.test.cpp b/src/tools/disco/functions/test/functions.test.cpp index 04a0294..d727592 100644 --- a/src/tools/disco/functions/test/functions.test.cpp +++ b/src/tools/disco/functions/test/functions.test.cpp @@ -12,7 +12,7 @@ using namespace njoy::tools::disco; SCENARIO( "functions" ) { std::string string = " a\t\n\r\n\f"; - string += char{ std::char_traits::eof() }; + string += std::char_traits::eof(); auto iter = string.begin(); unsigned int position = 0; From 412902b2d665e3f74c31df129e8a13dd2282297e Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Tue, 28 Jan 2025 15:04:12 -0700 Subject: [PATCH 3/6] Updating release notes --- ReleaseNotes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index a2794d6..9fe5705 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -6,6 +6,8 @@ Bug fixes: - iterator guards were added to the disco parser to avoid valgrind errors in ENDFtk. - the stride_view iterator was missing the reference type, which is required to create vectors using these stride view iterators in C++17. +A few updates were made in the CMake files for Windows compilation issues. The GitHub CI was also updated: macos-14 (arm64 architecture) was added in addition to macos-13 (intel architecture). + ## [tools v0.4.0](https://github.com/njoy/tools/pull/44) New features: - added a partial implementation of the C++23 ranges standard: chunk_view, chunk_by_view, stride_view and repeat_view (LLVM implementations for these views were used as models for our C++17 based implementations) From e229c5f0a000ec17342a43612f58bc95aac93e7f Mon Sep 17 00:00:00 2001 From: Joe Peterson Date: Wed, 29 Jan 2025 12:46:22 -0700 Subject: [PATCH 4/6] Remove addition of EOF char and EOF test in string check --- .../disco/BaseField/test/BaseField.test.cpp | 7 +------ .../test/BaseFixedWidthField.test.cpp | 7 +------ .../test/FreeFormatInteger.test.cpp | 1 - .../FreeFormatReal/test/FreeFormatReal.test.cpp | 1 - src/tools/disco/Integer/test/Integer.test.cpp | 1 - src/tools/disco/Real/test/Real.test.cpp | 1 - .../disco/functions/test/functions.test.cpp | 16 ---------------- 7 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/tools/disco/BaseField/test/BaseField.test.cpp b/src/tools/disco/BaseField/test/BaseField.test.cpp index 2c52df7..5749d84 100644 --- a/src/tools/disco/BaseField/test/BaseField.test.cpp +++ b/src/tools/disco/BaseField/test/BaseField.test.cpp @@ -17,15 +17,10 @@ class TestBaseField : protected BaseField { }; SCENARIO( "BaseField" ) { - - std::string string = " a\t\n\r\n\f"; - string += std::char_traits::eof(); + std::string string = "+abc"; auto iter = string.begin(); unsigned int position = 0; - string = "+abc"; - position = 0; - iter = string.begin(); TestBaseField::skipPlusSign( iter, position ); CHECK( iter == string.begin() + 1 ); CHECK( position == 1 ); diff --git a/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp b/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp index d392013..85f77ba 100644 --- a/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp +++ b/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp @@ -19,15 +19,10 @@ class TestBaseFixedWidthField : protected BaseFixedWidthField< Width > { }; SCENARIO( "BaseFixedWidthField" ) { - - std::string string = " a\t\n\r\n\f"; - string += std::char_traits::eof(); + std::string string = "+abc"; auto iter = string.begin(); unsigned int position = 0; - string = "+abc"; - position = 0; - iter = string.begin(); TestBaseFixedWidthField< 6 >::skipPlusSign( iter, position ); CHECK( iter == string.begin() + 1 ); CHECK( position == 1 ); diff --git a/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp b/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp index 9e79981..2aea2e5 100644 --- a/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp +++ b/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp @@ -105,7 +105,6 @@ SCENARIO( "Integer" ) { CHECK( iter == end - 1 ); string = " +123"; - string += std::char_traits::eof(); iter = string.begin(); end = string.end(); CHECK( 123 == FreeFormatInteger::read< int >( iter, end ) ); diff --git a/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp b/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp index e1b4ddf..962ef68 100644 --- a/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp +++ b/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp @@ -215,7 +215,6 @@ SCENARIO( "Integer" ) { CHECK( iter == end - 1 ); string = " +123"; - string += std::char_traits::eof(); iter = string.begin(); end = string.end(); CHECK_THAT( 123, WithinRel( FreeFormatReal::read< double >( iter, end ) ) ); diff --git a/src/tools/disco/Integer/test/Integer.test.cpp b/src/tools/disco/Integer/test/Integer.test.cpp index de4ddf0..09ac050 100644 --- a/src/tools/disco/Integer/test/Integer.test.cpp +++ b/src/tools/disco/Integer/test/Integer.test.cpp @@ -86,7 +86,6 @@ SCENARIO( "Integer" ) { CHECK( begin == end - 1 ); string = " +123"; - string += std::char_traits::eof(); begin = string.begin(); end = string.end(); CHECK( 123 == Integer< 10 >::read< int >( begin, end ) ); diff --git a/src/tools/disco/Real/test/Real.test.cpp b/src/tools/disco/Real/test/Real.test.cpp index 4e50e42..b0eacee 100644 --- a/src/tools/disco/Real/test/Real.test.cpp +++ b/src/tools/disco/Real/test/Real.test.cpp @@ -220,7 +220,6 @@ SCENARIO( "Real" ) { CHECK( begin == end - 1 ); string = " +123"; - string += std::char_traits::eof(); begin = string.begin(); end = string.end(); CHECK_THAT( 123, WithinRel( Real< 10 >::read< double >( begin, end ) ) ); diff --git a/src/tools/disco/functions/test/functions.test.cpp b/src/tools/disco/functions/test/functions.test.cpp index d727592..a543293 100644 --- a/src/tools/disco/functions/test/functions.test.cpp +++ b/src/tools/disco/functions/test/functions.test.cpp @@ -12,7 +12,6 @@ using namespace njoy::tools::disco; SCENARIO( "functions" ) { std::string string = " a\t\n\r\n\f"; - string += std::char_traits::eof(); auto iter = string.begin(); unsigned int position = 0; @@ -24,7 +23,6 @@ SCENARIO( "functions" ) { CHECK( false == isSpace( iter ) ); ++iter; CHECK( false == isSpace( iter ) ); ++iter; CHECK( false == isSpace( iter ) ); ++iter; - CHECK( false == isSpace( iter ) ); ++iter; CHECK( iter == string.end() ); iter = string.begin(); @@ -35,7 +33,6 @@ SCENARIO( "functions" ) { CHECK( false == isSpaceOrTabulation( iter ) ); ++iter; CHECK( false == isSpaceOrTabulation( iter ) ); ++iter; CHECK( false == isSpaceOrTabulation( iter ) ); ++iter; - CHECK( false == isSpaceOrTabulation( iter ) ); ++iter; CHECK( iter == string.end() ); iter = string.begin(); @@ -46,7 +43,6 @@ SCENARIO( "functions" ) { CHECK( true == isWhiteSpace( iter ) ); ++iter; CHECK( true == isWhiteSpace( iter ) ); ++iter; CHECK( true == isWhiteSpace( iter ) ); ++iter; - CHECK( false == isWhiteSpace( iter ) ); ++iter; CHECK( iter == string.end() ); iter = string.begin(); @@ -61,17 +57,5 @@ SCENARIO( "functions" ) { CHECK( iter == string.begin() + 5 ); ++iter; // \f is a newline CHECK( true == isNewLine( iter ) ); ++iter; - CHECK( false == isNewLine( iter ) ); ++iter; - CHECK( iter == string.end() ); - - iter = string.begin(); - CHECK( false == isEndOfFile( iter ) ); ++iter; - CHECK( false == isEndOfFile( iter ) ); ++iter; - CHECK( false == isEndOfFile( iter ) ); ++iter; - CHECK( false == isEndOfFile( iter ) ); ++iter; - CHECK( false == isEndOfFile( iter ) ); ++iter; - CHECK( false == isEndOfFile( iter ) ); ++iter; - CHECK( false == isEndOfFile( iter ) ); ++iter; - CHECK( true == isEndOfFile( iter ) ); ++iter; CHECK( iter == string.end() ); } // SCENARIO From 50ee77f0c1c159494b12c5ccd142a9e17e3dc96b Mon Sep 17 00:00:00 2001 From: Joe Peterson Date: Wed, 29 Jan 2025 12:54:39 -0700 Subject: [PATCH 5/6] Remove unneeded test which used to have EOF --- .../disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp | 6 ------ src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp | 6 ------ src/tools/disco/Integer/test/Integer.test.cpp | 6 ------ src/tools/disco/Real/test/Real.test.cpp | 6 ------ 4 files changed, 24 deletions(-) diff --git a/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp b/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp index 2aea2e5..734a69e 100644 --- a/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp +++ b/src/tools/disco/FreeFormatInteger/test/FreeFormatInteger.test.cpp @@ -103,12 +103,6 @@ SCENARIO( "Integer" ) { end = string.end(); CHECK( 123 == FreeFormatInteger::read< int >( iter, end ) ); CHECK( iter == end - 1 ); - - string = " +123"; - iter = string.begin(); - end = string.end(); - CHECK( 123 == FreeFormatInteger::read< int >( iter, end ) ); - CHECK( iter == end - 1 ); } // THEN } // GIVEN diff --git a/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp b/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp index 962ef68..8efb2be 100644 --- a/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp +++ b/src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp @@ -213,12 +213,6 @@ SCENARIO( "Integer" ) { end = string.end(); CHECK_THAT( 123, WithinRel( FreeFormatReal::read< double >( iter, end ) ) ); CHECK( iter == end - 1 ); - - string = " +123"; - iter = string.begin(); - end = string.end(); - CHECK_THAT( 123, WithinRel( FreeFormatReal::read< double >( iter, end ) ) ); - CHECK( iter == end - 1 ); } // THEN } // GIVEN diff --git a/src/tools/disco/Integer/test/Integer.test.cpp b/src/tools/disco/Integer/test/Integer.test.cpp index 09ac050..f562f42 100644 --- a/src/tools/disco/Integer/test/Integer.test.cpp +++ b/src/tools/disco/Integer/test/Integer.test.cpp @@ -84,12 +84,6 @@ SCENARIO( "Integer" ) { end = string.end(); CHECK( 123 == Integer< 10 >::read< int >( begin, end ) ); CHECK( begin == end - 1 ); - - string = " +123"; - begin = string.begin(); - end = string.end(); - CHECK( 123 == Integer< 10 >::read< int >( begin, end ) ); - CHECK( begin == end - 1 ); } // THEN } // GIVEN diff --git a/src/tools/disco/Real/test/Real.test.cpp b/src/tools/disco/Real/test/Real.test.cpp index b0eacee..8441cb2 100644 --- a/src/tools/disco/Real/test/Real.test.cpp +++ b/src/tools/disco/Real/test/Real.test.cpp @@ -218,12 +218,6 @@ SCENARIO( "Real" ) { end = string.end(); CHECK_THAT( 123, WithinRel( Real< 10 >::read< double >( begin, end ) ) ); CHECK( begin == end - 1 ); - - string = " +123"; - begin = string.begin(); - end = string.end(); - CHECK_THAT( 123, WithinRel( Real< 10 >::read< double >( begin, end ) ) ); - CHECK( begin == end - 1 ); } // THEN } // GIVEN From cc038e98a3455604de72d0ce46c9e53a0def3a03 Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Wed, 29 Jan 2025 13:04:01 -0700 Subject: [PATCH 6/6] Some more changes --- src/tools/disco/BaseField/test/BaseField.test.cpp | 1 + .../disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tools/disco/BaseField/test/BaseField.test.cpp b/src/tools/disco/BaseField/test/BaseField.test.cpp index 5749d84..62630de 100644 --- a/src/tools/disco/BaseField/test/BaseField.test.cpp +++ b/src/tools/disco/BaseField/test/BaseField.test.cpp @@ -17,6 +17,7 @@ class TestBaseField : protected BaseField { }; SCENARIO( "BaseField" ) { + std::string string = "+abc"; auto iter = string.begin(); unsigned int position = 0; diff --git a/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp b/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp index 85f77ba..91f6782 100644 --- a/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp +++ b/src/tools/disco/BaseFixedWidthField/test/BaseFixedWidthField.test.cpp @@ -19,6 +19,7 @@ class TestBaseFixedWidthField : protected BaseFixedWidthField< Width > { }; SCENARIO( "BaseFixedWidthField" ) { + std::string string = "+abc"; auto iter = string.begin(); unsigned int position = 0;