Coverage Report

Created: 2025-07-12 06:46

/src/brunsli/c/dec/state.cc
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) Google LLC 2020
2
//
3
// Use of this source code is governed by an MIT-style
4
// license that can be found in the LICENSE file or at
5
// https://opensource.org/licenses/MIT.
6
7
#include "./state.h"
8
9
#include <brotli/decode.h>
10
#include "./state_internal.h"
11
12
namespace brunsli {
13
namespace internal {
14
namespace dec {
15
16
16.3k
State::State() : internal(new InternalState()) {}
17
18
0
State::State(State&&) = default;
19
20
16.3k
State::~State() {}
21
22
16.3k
MetadataState::~MetadataState() {
23
16.3k
  if (brotli != nullptr) {
24
1.95k
    BrotliDecoderDestroyInstance(brotli);
25
1.95k
    brotli = nullptr;
26
1.95k
  }
27
16.3k
}
28
29
411k
bool HasSection(const State* state, uint32_t tag) {
30
411k
  return state->internal->section.tags_met & (1u << tag);
31
411k
}
32
33
}  // namespace dec
34
}  // namespace internal
35
}  // namespace brunsli