stdio_file.cpp 468 B

12345678910111213141516171819202122232425262728
  1. #include<__vic/stdio_file.h>
  2. #include<__vic/error.h>
  3. #include<iostream>
  4. #include<exception>
  5. #include<cassert>
  6. void run_tests()
  7. {
  8. __vic::stdio_file file("stdio_file.cpp", "r");
  9. if(!file.is_open()) throw __vic::exception("Cannot open file");
  10. std::fgetc(file);
  11. file.close();
  12. }
  13. int main()
  14. {
  15. try
  16. {
  17. run_tests();
  18. return 0;
  19. }
  20. catch(const std::exception &ex)
  21. {
  22. std::cerr << ex.what() << '\n';
  23. }
  24. return 1;
  25. }