diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2009-04-17 18:26:48 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2009-04-17 18:26:48 -0400 |
commit | 2f493c010f5a49baaa8d41b13c8d5f120fae4d21 (patch) | |
tree | 91a746c39fcbd4c9c748424bde11b65f20497925 /tests | |
parent | c523797e9c5c306e169562a7c3dbe33978c66cc2 (diff) | |
download | gupnp-igd-2f493c010f5a49baaa8d41b13c8d5f120fae4d21.tar.gz |
Make the internal port into a define
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gtest/gupnp-simple-igd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/gtest/gupnp-simple-igd.c b/tests/gtest/gupnp-simple-igd.c index e26d076..56e8285 100644 --- a/tests/gtest/gupnp-simple-igd.c +++ b/tests/gtest/gupnp-simple-igd.c @@ -36,6 +36,8 @@ #define PPP_ADDRESS_FIRST "127.0.0.4" #define PPP_ADDRESS_SECOND "127.0.0.5" +#define INTERNAL_PORT 6543 + typedef enum { CONNECTION_IP, CONNECTION_PPP @@ -111,7 +113,7 @@ add_port_mapping_cb (GUPnPService *service, g_assert (remote_host && !strcmp (remote_host, "")); g_assert (external_port == requested_external_port); g_assert (proto && (!strcmp (proto, "UDP") || !strcmp (proto, "TCP"))); - g_assert (internal_port == 6543); + g_assert (internal_port == INTERNAL_PORT); g_assert (internal_client && !strcmp (internal_client, "192.168.4.22")); g_assert (enabled == TRUE); g_assert (desc != NULL); @@ -162,7 +164,7 @@ mapped_external_port_cb (GUPnPSimpleIgd *igd, gchar *proto, g_assert (external_port == requested_external_port); g_assert (proto && !strcmp (proto, "UDP")); - g_assert (local_port == 6543); + g_assert (local_port == INTERNAL_PORT); g_assert (local_ip && !strcmp (local_ip, "192.168.4.22")); g_assert (description != NULL); @@ -264,7 +266,7 @@ run_gupnp_simple_igd_test (GMainContext *mainctx, GUPnPSimpleIgd *igd, G_CALLBACK (error_mapping_port_cb), NULL); gupnp_simple_igd_add_port (igd, "UDP", requested_port, "192.168.4.22", - 6543, 10, "GUPnP Simple IGD test"); + INTERNAL_PORT, 10, "GUPnP Simple IGD test"); loop = g_main_loop_new (mainctx, FALSE); @@ -278,7 +280,7 @@ test_gupnp_simple_igd_default_ctx (void) { GUPnPSimpleIgd *igd = gupnp_simple_igd_new (NULL); - run_gupnp_simple_igd_test (NULL, igd, 6543); + run_gupnp_simple_igd_test (NULL, igd, INTERNAL_PORT); g_object_unref (igd); } @@ -288,7 +290,7 @@ test_gupnp_simple_igd_custom_ctx (void) GMainContext *mainctx = g_main_context_new (); GUPnPSimpleIgd *igd = gupnp_simple_igd_new (mainctx); - run_gupnp_simple_igd_test (mainctx, igd, 6543); + run_gupnp_simple_igd_test (mainctx, igd, INTERNAL_PORT); g_object_unref (igd); g_main_context_unref (mainctx); } @@ -300,7 +302,7 @@ test_gupnp_simple_igd_thread (void) GUPnPSimpleIgdThread *igd = gupnp_simple_igd_thread_new (); GMainContext *mainctx = g_main_context_new (); - run_gupnp_simple_igd_test (mainctx, GUPNP_SIMPLE_IGD (igd), 6543); + run_gupnp_simple_igd_test (mainctx, GUPNP_SIMPLE_IGD (igd), INTERNAL_PORT); g_object_unref (igd); g_main_context_unref (mainctx); } |