test_rtp.cpp 454 B

1234567891011121314151617
  1. #include <gtest/gtest.h>
  2. #include "rtp.h"
  3. #include "rtpsession.h"
  4. TEST(TestRTPSession, CreateSocket)
  5. {
  6. rtp_session_t* rtp_sess;
  7. int rc = rtp_session_create("127.0.0.1", 1024, 2, &rtp_sess);
  8. ASSERT_TRUE(rc == 0);
  9. EXPECT_TRUE(0 == rtp_session_reset(rtp_sess, 3, "99.12.22.154", 5096, 5096 + 1));
  10. int rtp_fd = -1;
  11. rtp_session_get_raw_fd(rtp_sess, &rtp_fd, NULL);
  12. EXPECT_TRUE(rtp_fd != -1);
  13. rtp_session_destroy(rtp_sess);
  14. }