• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

melchor629 / node-flac-bindings / 13604713414

01 Mar 2025 12:22PM UTC coverage: 91.073% (+9.3%) from 81.781%
13604713414

push

github

melchor629
fix: native code coverage

159 of 202 branches covered (78.71%)

Branch coverage included in aggregate %.

4 of 5 new or added lines in 2 files covered. (80.0%)

72 existing lines in 2 files now uncovered.

5003 of 5466 relevant lines covered (91.53%)

37359.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.56
/src/index.cpp
1
#include "decoder/decoder.hpp"
2
#include "encoder/encoder.hpp"
3
#include "flac_addon.hpp"
4
#include "mappings/mappings.hpp"
5
#include "mappings/native_iterator.hpp"
6
#include <napi.h>
7

8
#ifdef COVERAGE
9
extern "C" void __gcov_dump(void);
10
#endif
11

12
namespace flac_bindings {
13

14
  using namespace Napi;
15

16
  extern Promise testAsync(const CallbackInfo& info);
17
  extern Object initFormat(const Env& env);
18
  extern Object initMetadata0(const Env& env);
19
  extern Function initMetadata1(Env env, FlacAddon&);
20
  extern Value initMetadata2Chain(Env env, FlacAddon&);
21
  extern Value initMetadata2Iterator(Env env, FlacAddon&);
22
  extern Object initFns(Env env);
23

24
  FlacAddon::FlacAddon(Env env, Object exports) {
21✔
25
    NativeIterator::init(env, *this);
21✔
26

27
    DefineAddon(
21✔
28
      exports,
29
      {
30
        InstanceValue("_testAsync", Function::New(env, testAsync, "_testAsync")),
21✔
31
        InstanceValue("napiVersion", Number::New(env, NAPI_VERSION), napi_enumerable),
21✔
32
        InstanceValue("EncoderBuilder", StreamEncoderBuilder::init(env, *this), napi_enumerable),
21✔
33
        InstanceValue("Encoder", StreamEncoder::init(env, *this), napi_enumerable),
21✔
34
        InstanceValue("DecoderBuilder", StreamDecoderBuilder::init(env, *this), napi_enumerable),
21✔
35
        InstanceValue("Decoder", StreamDecoder::init(env, *this), napi_enumerable),
21✔
36
        InstanceValue("format", initFormat(env), napi_enumerable),
21✔
37
        InstanceValue(
21✔
38
          "metadata",
39
          DefineProperties(
21✔
40
            Object::New(env),
41
            {
42
              InstanceValue(
21✔
43
                "StreamInfoMetadata",
44
                StreamInfoMetadata::init(env, *this),
21✔
45
                napi_enumerable),
46
              InstanceValue("PaddingMetadata", PaddingMetadata::init(env, *this), napi_enumerable),
21✔
47
              InstanceValue(
21✔
48
                "ApplicationMetadata",
49
                ApplicationMetadata::init(env, *this),
21✔
50
                napi_enumerable),
51
              InstanceValue(
21✔
52
                "SeekTableMetadata",
53
                SeekTableMetadata::init(env, *this),
21✔
54
                napi_enumerable),
55
              InstanceValue("SeekPoint", SeekPoint::init(env, *this), napi_enumerable),
21✔
56
              InstanceValue(
21✔
57
                "VorbisCommentMetadata",
58
                VorbisCommentMetadata::init(env, *this),
21✔
59
                napi_enumerable),
60
              InstanceValue(
21✔
61
                "CueSheetMetadata",
62
                CueSheetMetadata::init(env, *this),
21✔
63
                napi_enumerable),
64
              InstanceValue("CueSheetIndex", CueSheetIndex::init(env, *this), napi_enumerable),
21✔
65
              InstanceValue("CueSheetTrack", CueSheetTrack::init(env, *this), napi_enumerable),
21✔
66
              InstanceValue("PictureMetadata", PictureMetadata::init(env, *this), napi_enumerable),
21✔
67
              InstanceValue("UnknownMetadata", UnknownMetadata::init(env, *this), napi_enumerable),
21✔
68
            }),
69
          napi_enumerable),
70
        InstanceValue("metadata0", initMetadata0(env), napi_enumerable),
21✔
71
        InstanceValue("SimpleIterator", initMetadata1(env, *this), napi_enumerable),
21✔
72
        InstanceValue("Chain", initMetadata2Chain(env, *this), napi_enumerable),
21✔
73
        InstanceValue("Iterator", initMetadata2Iterator(env, *this), napi_enumerable),
21✔
74
        InstanceValue("fns", initFns(env), napi_enumerable),
21✔
75
#ifdef COVERAGE
76
        InstanceValue(
21✔
77
          "_coverageFlush",
78
          Function::New(env, [] (const CallbackInfo& info) {
21✔
79
            __gcov_dump();
21✔
NEW
80
            return info.Env().Undefined();
×
81
          }, "_coverageFlush")
82
        ),
83
#endif
84
      });
85

86
    exports.Freeze();
21✔
87

88
    module = Persistent(exports);
21✔
89
  }
21✔
90

91
}
92

93
using namespace flac_bindings;
94
NODE_API_NAMED_ADDON(flac_bindings, FlacAddon);
21✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc