vimix

test_input

Mar 30th, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1.  
  2. // Filename: test_input.cpp
  3. // Description: Tests string's input method
  4. //Author: Venix Cador
  5. // Date: 02/24/2013
  6.  
  7. #include "string.h"
  8. #include <cassert>
  9. #include <fstream>
  10.  
  11. int main()
  12. {
  13. std::ifstream in("input_test_data.txt");
  14.  
  15. if(!in){
  16. std::cerr <<"could not open input_test_data.txt, existing!" <<std::endl;
  17. std::exit(1);
  18. }
  19.  
  20. {
  21. String input;
  22. in >> input;
  23. std::cout << "'" << input << "'" <<std::endl;
  24. assert(input == " Almost there to get something to eat");
  25.  
  26. }
  27. in.close();
  28.  
  29. std::cout << "Completed tsting string's input function!" << std::endl;
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment