mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 18:00:06 +00:00 
			
		
		
		
	Parse Clutter Filter Map (Message 15)
This commit is contained in:
		
							parent
							
								
									f36d57b71d
								
							
						
					
					
						commit
						3ab4ec4b9b
					
				
					 15 changed files with 682 additions and 22 deletions
				
			
		
							
								
								
									
										37
									
								
								test/source/scwx/util/vectorbuf.test.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								test/source/scwx/util/vectorbuf.test.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,37 @@ | |||
| #include <scwx/util/vectorbuf.hpp> | ||||
| 
 | ||||
| #include <gtest/gtest.h> | ||||
| 
 | ||||
| namespace scwx | ||||
| { | ||||
| namespace util | ||||
| { | ||||
| 
 | ||||
| TEST(vectorbuf, smiles) | ||||
| { | ||||
|    std::vector<char> v; | ||||
|    vectorbuf         vb(v); | ||||
|    std::istream      is(&vb); | ||||
| 
 | ||||
|    v.reserve(7); | ||||
|    memcpy(v.data(), "smiles", 7); | ||||
|    vb.update_read_pointers(7); | ||||
| 
 | ||||
|    EXPECT_EQ(is.eof(), false); | ||||
|    EXPECT_EQ(is.fail(), false); | ||||
| 
 | ||||
|    char data[7]; | ||||
|    is.read(data, 7); | ||||
| 
 | ||||
|    EXPECT_EQ(std::string(data), std::string("smiles")); | ||||
|    EXPECT_EQ(is.eof(), false); | ||||
|    EXPECT_EQ(is.fail(), false); | ||||
| 
 | ||||
|    is.read(data, 1); | ||||
| 
 | ||||
|    EXPECT_EQ(is.eof(), true); | ||||
|    EXPECT_EQ(is.fail(), true); | ||||
| } | ||||
| 
 | ||||
| } // namespace util
 | ||||
| } // namespace scwx
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat