File: sync_conn_seed_add_cache.c

package info (click to toggle)
libmongo-client 0.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,384 kB
  • ctags: 770
  • sloc: ansic: 14,979; makefile: 322; perl: 137; sh: 48
file content (31 lines) | stat: -rw-r--r-- 1,061 bytes parent folder | download | duplicates (4)
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
#include "test.h"
#include "mongo.h"

void
test_mongo_sync_connection_cache_seed_add (void)
{
  mongo_sync_conn_recovery_cache *cache;

  cache = mongo_sync_conn_recovery_cache_new ();

  ok (mongo_sync_conn_recovery_cache_seed_add (cache,
                                               "localhost",
                                               27017) == TRUE,
      "mongo_sync_connection_cache_seed_add() works");

  ok (mongo_sync_conn_recovery_cache_seed_add (cache,
                                               NULL,
                                               27017) == FALSE,
      "mongo_sync_connection_cache_seed_add() should fail with a NULL host");

  mongo_sync_conn_recovery_cache_discard (cache);

  ok (mongo_sync_conn_recovery_cache_seed_add (cache,
                                               "localhost",
                                               27017) == TRUE,
      "mongo_sync_connection_cache_seed_add() works");
      
  mongo_sync_conn_recovery_cache_free (cache);
}

RUN_TEST (3, mongo_sync_connection_cache_seed_add);