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

« back to all changes in this revision

Viewing changes to modules/afmongodb/libmongo-client/tests/unit/bson/bson_append_double.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
#include "bson.h"
 
4
 
 
5
#include <string.h>
 
6
 
 
7
void
 
8
test_bson_double (void)
 
9
{
 
10
  bson *b;
 
11
  double d = 3.14;
 
12
 
 
13
  b = bson_new ();
 
14
  ok (bson_append_double (b, "double", d), "bson_append_double() works");
 
15
  bson_finish (b);
 
16
 
 
17
  cmp_ok (bson_size (b), "==", 21, "BSON double element size check");
 
18
  ok (memcmp (bson_data (b),
 
19
              "\025\000\000\000\001\144\157\165\142\154\145\000\037\205\353"
 
20
              "\121\270\036\011\100\000",
 
21
              bson_size (b)) == 0,
 
22
      "BSON double element contents check");
 
23
 
 
24
  bson_free (b);
 
25
 
 
26
  b = bson_new ();
 
27
  ok (bson_append_double (b, NULL, d) == FALSE,
 
28
      "bson_append_double() with a NULL key should fail");
 
29
  ok (bson_append_double (NULL, "double", d) == FALSE,
 
30
      "bson_append_double() without a BSON object should fail");
 
31
  bson_finish (b);
 
32
  cmp_ok (bson_size (b), "==", 5,
 
33
          "BSON object should be empty");
 
34
 
 
35
  ok (bson_append_double (b, "d", d) == FALSE,
 
36
      "Appending to a finished element should fail");
 
37
 
 
38
  bson_free (b);
 
39
}
 
40
 
 
41
RUN_TEST (7, bson_double);