Browse Source
			
			
			Fixed problem with Windows linebreak \r\n, because this is still a problem in 2020
			
			
				main
			
			
		
		Fixed problem with Windows linebreak \r\n, because this is still a problem in 2020
	
		
	
			
			
				main
			
			
		
				 6 changed files with 63 additions and 20 deletions
			
			
		- 
					2src/storm-dft/parser/DFTGalileoParser.cpp
- 
					2src/storm-gspn/api/storm-gspn.cpp
- 
					30src/storm-parsers/parser/DirectEncodingParser.cpp
- 
					2src/storm/settings/SettingsManager.cpp
- 
					23src/storm/utility/file.h
- 
					24src/test/storm/utility/FileTest.cpp
| @ -0,0 +1,24 @@ | |||
| #include "test/storm_gtest.h"
 | |||
| #include "storm-config.h"
 | |||
| 
 | |||
| #include "storm/utility/file.h"
 | |||
| 
 | |||
| TEST(FileTest, GetLine) { | |||
|     std::stringstream stream; | |||
|     stream << "Hello world" << std::endl << "This is a test with n\nThis is a test with rn\r\n\nMore tests"; | |||
| 
 | |||
|     std::string str; | |||
|     int i = 0; | |||
|     std::string expected[] = {"Hello world", "This is a test with n", "This is a test with rn", "", "More tests"}; | |||
|     while (storm::utility::getline(stream, str)) { | |||
|         EXPECT_EQ(str, expected[i]); | |||
|         ++i; | |||
|     } | |||
| } | |||
| 
 | |||
| 
 | |||
| TEST(FileTest, GetLineEmpty) { | |||
|     std::stringstream stream; | |||
|     std::string str; | |||
|     EXPECT_FALSE(storm::utility::getline(stream, str)); | |||
| } | |||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue