~ubuntu-branches/ubuntu/trusty/syslog-ng/trusty-proposed

« back to all changes in this revision

Viewing changes to modules/afmongodb/libmongo-client/tests/perf/bson/p_bson_find.c

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS), Gergely Nagy
  • Date: 2011-10-11 14:30:48 UTC
  • mfrom: (1.3.7)
  • Revision ID: package-import@ubuntu.com-20111011143048-r1iljux9xbvj3lwh
Tags: 3.3.1.dfsg-1
* New upstream release with important fixes from upstream git tree with
  non-free manpages removed.
* Drop syslog-ng.conf(5) (closes: #496521).
* syslog-ng(8) is generated, and does not mention -Q anymore
  (closes: #616069).
* Supports CAP_SYSLOG on recent kernels (closes: #630172).
* Does not use g_timeout_add_seconds anymore (closes: #609154).

[ Gergely Nagy <algernon@madhouse-project.org> ]
* Update debian/copyright to DEP-5 format.
* Simplified the logrotate file by merging identical entries.
* Include local configuration files from /etc/syslog-ng/conf.d/ (Closes:
  #609050).
* Update syslog-ng.conf to be fully 3.3 compliant.
* Compress both source and binaries (except the syslog-ng meta
  package) with xz, instead of gzip.
* Use dpkg triggers to restart syslog-ng when appropriate.
* Include DFSG-free manual pages for all binaries.
* Build with Hardening enabled.
* Mention syslog(3) in /etc/default/syslog-ng, instead of
  <linux/kernel.h> (Closes: #608605)
* Support 'status' in the init script.
  Patch from Peter Eisentraut <petere@debian.org> (Closes: #644458)
* Build-Depend on libevtlog-dev (>= 0.2.12-5~) for correct shlibs.
* Use [linux-any] in Build-Depends instead of hardcoded links.
  (Closes: #634715)
* Use $SYSLOGNG_OPTS in the init script when reloading syslog-ng.
  (Closes: #589081)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "tap.h"
 
2
#include "test.h"
 
3
 
 
4
#include <mongo.h>
 
5
 
 
6
#define MAX_KEYS 10000
 
7
 
 
8
void
 
9
test_p_bson_find (void)
 
10
{
 
11
  bson *b;
 
12
  bson_cursor *c;
 
13
  gint i;
 
14
  gchar **keys;
 
15
  gboolean ret = TRUE;
 
16
 
 
17
  keys = g_new(gchar *, MAX_KEYS);
 
18
 
 
19
  b = bson_new ();
 
20
  for (i = 0; i < MAX_KEYS; i++)
 
21
    {
 
22
      keys[i] = g_strdup_printf ("tmp_key_%d", i);
 
23
      bson_append_int32 (b, keys[i], i);
 
24
    }
 
25
  bson_finish (b);
 
26
 
 
27
  for (i = 1; i <= MAX_KEYS; i++)
 
28
    {
 
29
      c = bson_find (b, keys[i - 1]);
 
30
      if (!c)
 
31
        ret = FALSE;
 
32
      bson_cursor_free (c);
 
33
      g_free (keys[i - 1]);
 
34
    }
 
35
 
 
36
  bson_free (b);
 
37
  g_free (keys);
 
38
 
 
39
  ok (ret == TRUE,
 
40
      "bson_find() performance test ok");
 
41
}
 
42
 
 
43
RUN_TEST (1, p_bson_find);