LCOV - app.info - js/src/jsapi-tests/testUTF8.cpp

LCOV - code coverage report
| Current view: | directory - js/src/jsapi-tests - testUTF8.cpp (source / functions) |  | Found | Hit | Coverage |
| Test: | app.info | Lines: | 9 | 9 | 100.0 %
| Date: | 2012-04-07 | Functions: | 8 | 6 | 75.0 %

           1                 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
           2                 :  * vim: set ts=8 sw=4 et tw=99:
           3                 :  */
           4                 :
           5                 : #include "tests.h"
           6                 :
           7               4 : BEGIN_TEST(testUTF8_bug589917)
           8                 : {
           9               1 :     const jschar surrogate_pair[] = { 0xd800, 0xdc00 };
          10                 :     char output_buffer[10];
          11               1 :     size_t utf8_len = sizeof(output_buffer);
          12                 :
          13               1 :     CHECK(JS_EncodeCharacters(cx, surrogate_pair, 2, output_buffer, &utf8_len));
          14               1 :     CHECK_EQUAL(utf8_len, 4);
          15                 :
          16               1 :     CHECK(JS_EncodeCharacters(cx, surrogate_pair, 2, NULL, &utf8_len));
          17               1 :     CHECK_EQUAL(utf8_len, 4);
          18                 :
          19               1 :     return true;
          20                 : }
          21               2 : END_TEST(testUTF8_bug589917)

Generated by: LCOV version 1.7