Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 1 | #include <assert.h> |
| 2 | #include <netdb.h> |
| 3 | |
Roger Meier | e3da768 | 2013-01-11 11:41:53 +0100 | [diff] [blame^] | 4 | #include <thrift/c_glib/transport/thrift_server_transport.h> |
| 5 | #include <thrift/c_glib/transport/thrift_server_socket.h> |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 6 | |
| 7 | static const char TEST_ADDRESS[] = "localhost"; |
| 8 | static const int TEST_PORT = 64444; |
| 9 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 10 | static void |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 11 | test_thrift_server (const int port) |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 12 | { |
| 13 | ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET, |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 14 | "port", TEST_PORT, NULL); |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 15 | |
| 16 | g_object_unref (tsocket); |
| 17 | } |
| 18 | |
| 19 | int |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 20 | main(int argc, char *argv[]) |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 21 | { |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 22 | g_type_init(); |
| 23 | g_test_init (&argc, &argv, NULL); |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 24 | |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 25 | g_test_add_func ("/testthrift/Server", test_thrift_server); |
| 26 | |
| 27 | return g_test_run (); |
| 28 | } |