Added JSON testing application
This commit is contained in:
		
							parent
							
								
									aee6420943
								
							
						
					
					
						commit
						e2d8321760
					
				
					 2 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
					@ -705,4 +705,7 @@ add_test(LOGTest COMMAND urltest)
 | 
				
			||||||
add_executable(downloadertest test/downloader.cpp ${BINARY_DIR}/mist/.headers)
 | 
					add_executable(downloadertest test/downloader.cpp ${BINARY_DIR}/mist/.headers)
 | 
				
			||||||
target_link_libraries(downloadertest mist)
 | 
					target_link_libraries(downloadertest mist)
 | 
				
			||||||
add_test(DownloaderTest COMMAND downloadertest)
 | 
					add_test(DownloaderTest COMMAND downloadertest)
 | 
				
			||||||
 | 
					add_executable(jsontest test/json.cpp ${BINARY_DIR}/mist/.headers)
 | 
				
			||||||
 | 
					target_link_libraries(jsontest mist)
 | 
				
			||||||
 | 
					add_test(JSONTest COMMAND jsontest)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										14
									
								
								test/json.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								test/json.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					#include "../lib/json.cpp"
 | 
				
			||||||
 | 
					#include <iostream>
 | 
				
			||||||
 | 
					#include <string>
 | 
				
			||||||
 | 
					#include <sstream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main(int argc, char ** argv){
 | 
				
			||||||
 | 
					  std::string line;
 | 
				
			||||||
 | 
					  std::stringstream jData;
 | 
				
			||||||
 | 
					  while (getline(std::cin, line)){jData << line;}
 | 
				
			||||||
 | 
					  JSON::Value J = JSON::fromString(jData.str().data(), jData.str().size());
 | 
				
			||||||
 | 
					  std::cout << J.toPrettyString() << std::endl;
 | 
				
			||||||
 | 
					  return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue