Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #pragma once
  2. #include <string>
  3.  
  4. std::string getGreeting();
  5.  
  6. #include "Greeting.h"
  7.  
  8. std::string getGreeting() {
  9. return "Hello world!";
  10. }
  11.  
  12. #pragma once
  13. void test();
  14.  
  15. #include "Test.h"
  16. #include "Greeting.h"
  17.  
  18. #include <cassert>
  19. #include <iostream>
  20.  
  21. void test() {
  22. auto greeting = getGreeting();
  23. assert(greeting == "Hello world!");
  24. std::cout << "Test passes!n";
  25. }
  26.  
  27. #include "Test.h"
  28. #include "Greeting.h"
  29.  
  30. #include <iostream>
  31.  
  32. void run() {
  33. std::cout << getGreeting() << "n";
  34. }
  35.  
  36. int main(int argc, char *argv[]) {
  37. if (argc > 1 && strcmp(argv[1], "-t") == 0)
  38. test();
  39. else
  40. run();
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement