summaryrefslogtreecommitdiff
path: root/tests/unit/mongo/utils/oid_as_string.c
blob: 9cf740ca72d91f06074c7caf00949c8b231b382b (plain)
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
#include "test.h"
#include "mongo.h"

void
test_mongo_utils_oid_as_string (void)
{
  guint8 *oid;
  gchar *oid_str;

  mongo_util_oid_init (0);

  oid = mongo_util_oid_new (1);

  ok (mongo_util_oid_as_string (NULL) == NULL,
      "mongo_util_oid_as_string() should fail with a NULL oid");

  oid_str = mongo_util_oid_as_string (oid);

  ok (oid_str != NULL,
      "mongo_util_oid_as_string() works");

  g_free (oid_str);
  g_free (oid);
}

RUN_TEST (2, mongo_utils_oid_as_string);