GameEventsTest.cc 944 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include <fcntl.h>
  2. #include <gtest/gtest.h>
  3. #include <gflags/gflags.h>
  4. #include <glog/logging.h>
  5. #include <iosfwd>
  6. #include "Event/GameEvents.h"
  7. #include "Event/NodeFactories.h"
  8. #include "Event/EventConf.pb.h"
  9. namespace Egametang {
  10. class GameEventsTest: public testing::Test
  11. {
  12. protected:
  13. NodeFactories factories;
  14. GameEvents game_events;
  15. public:
  16. GameEventsTest():factories(), game_events(factories)
  17. {
  18. }
  19. virtual ~GameEventsTest()
  20. {
  21. }
  22. };
  23. TEST_F(GameEventsTest, DotChangeHealth)
  24. {
  25. std::string conf_file = "../../../Cpp/Game/Event/DotFirstDamage.txt";
  26. EventConf conf;
  27. int fd = -1;
  28. fd = open(conf_file.c_str(), O_RDONLY);
  29. conf.ParseFromFileDescriptor(fd);
  30. VLOG(2) << "conf: " << conf.DebugString();
  31. close(fd);
  32. }
  33. } // namespace Egametang
  34. int main(int argc, char* argv[])
  35. {
  36. testing::InitGoogleTest(&argc, argv);
  37. google::ParseCommandLineFlags(&argc, &argv, true);
  38. google::InitGoogleLogging(argv[0]);
  39. return RUN_ALL_TESTS();
  40. }