@@ -12,14 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212See the License for the specific language governing permissions and
1313limitations under the License. */
1414
15- #include " paddle/utils/Util.h"
16-
1715#include < gtest/gtest.h>
18-
16+ # include < memory >
1917#include " ParameterService.pb.h"
2018#include " paddle/math/Vector.h"
2119#include " paddle/pserver/ProtoServer.h"
2220#include " paddle/utils/Stat.h"
21+ #include " paddle/utils/Util.h"
2322
2423DEFINE_string (server_addr, " 127.0.0.1" , " Server address" );
2524DEFINE_int64 (dim, 50000000 , " Data size" );
@@ -162,18 +161,9 @@ TEST(ProtoServer, extended) {
162161int main (int argc, char ** argv) {
163162 paddle::initMain (argc, argv);
164163 testing::InitGoogleTest (&argc, argv);
165-
166- MyServer* server;
167- if (FLAGS_rdma_tcp == " rdma" ) {
168- server = new MyServer (FLAGS_port, 0 );
169- } else {
170- server = new MyServer (FLAGS_port);
171- }
172-
173- server->start ();
164+ MyServer server (FLAGS_port, FLAGS_rdma_tcp == " rdma" ? 0 : -1 );
165+ server.start ();
174166 usleep (10000 );
175167
176- int ret = RUN_ALL_TESTS ();
177-
178- exit (ret);
168+ return RUN_ALL_TESTS ();
179169}
0 commit comments