aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check-empathy-irc-server.c
blob: e4f0b134756f99ade46927fc3d719fe4b7d908e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <check.h>
#include "check-helpers.h"
#include "check-libempathy.h"

#include <libempathy/empathy-irc-server.h>

START_TEST (test_empathy_irc_server_new)
{
  EmpathyIrcServer *server;
  gchar *address;
  guint port;
  gboolean ssl;

  server = empathy_irc_server_new ("test.localhost", 6667, TRUE);
  fail_if (server == NULL);

  g_object_get (server,
      "address", &address,
      "port", &port,
      "ssl", &ssl,
      NULL);

  fail_if (address == NULL || strcmp (address, "test.localhost") != 0);
  fail_if (port != 6667);
  fail_if (!ssl);

  g_free (address);
  g_object_unref (server);
}
END_TEST


TCase *
make_empathy_irc_server_tcase (void)
{
    TCase *tc = tcase_create ("empathy-irc-server");
    tcase_add_test (tc, test_empathy_irc_server_new);
    return tc;
}