test/channel_transport/udp_socket_manager_unittest.cc
TEST(UdpSocketManager, AddAndRemoveSocketDoesNotLeakMemory) {
  int32_t id = 42;
  uint8_t threads = 1;
  UdpSocketManager* mgr = UdpSocketManager::Create(id, threads);
  UdpSocketWrapper* socket =
      UdpSocketWrapper::CreateSocket(id,
                                     mgr,
                                     NULL,  // CallbackObj
                                     NULL,  // IncomingSocketCallback
                                     false,  // ipV6Enable
                                     false);  // disableGQOS
  // The constructor will do AddSocket on the manager.
  // RemoveSocket indirectly calls Delete.
  EXPECT_EQ(true, mgr->RemoveSocket(socket));
  UdpSocketManager::Return();
}
// Creates a socket and adds it to the socket manager, and then removes it
// before destroying the socket manager.
Creates a socket and adds it to the socket manager, and then removes it
before destroying the socket manager.
Creates a socket and adds it to the socket manager and then removes it before destroying the socket manager .
TEST(UdpSocketManager, AddAndRemoveSocketDoesNotLeakMemory) {
  int32_t id = 42;
  uint8_t threads = 1;
  UdpSocketManager* mgr = UdpSocketManager::Create(id, threads);
  UdpSocketWrapper* socket =
      UdpSocketWrapper::CreateSocket(id,
                                     mgr,
                                     NULL,  
                                     NULL,  
                                     false,  
                                     false);  
  EXPECT_EQ(true, mgr->RemoveSocket(socket));
  UdpSocketManager::Return();
}
TEST ( UdpSocketManager , AddAndRemoveSocketDoesNotLeakMemory ) { int32_t id = 42 ; uint8_t threads = 1 ; UdpSocketManager * mgr = UdpSocketManager :: Create ( id , threads ) ; UdpSocketWrapper * socket = UdpSocketWrapper :: CreateSocket ( id , mgr , NULL , NULL , false , false ) ; EXPECT_EQ ( true , mgr -> RemoveSocket ( socket ) ) ; UdpSocketManager :: Return ( ) ; }
Creates a socket and adds it to the socket manager, and then removes it
before destroying the socket manager.
Creates a socket and adds it to the socket manager and then removes it before destroying the socket manager .
// CallbackObj // IncomingSocketCallback // ipV6Enable // disableGQOS // The constructor will do AddSocket on the manager. // RemoveSocket indirectly calls Delete.