Coverage Report

Created: 2025-08-29 06:27

/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
18.8k
State::State() : internal(new InternalState()) {}
17
18
0
State::State(State&&) = default;
19
20
18.8k
State::~State() {}
21
22
18.8k
MetadataState::~MetadataState() {
23
18.8k
  if (brotli != nullptr) {
24
2.11k
    BrotliDecoderDestroyInstance(brotli);
25
2.11k
    brotli = nullptr;
26
2.11k
  }
27
18.8k
}
28
29
472k
bool HasSection(const State* state, uint32_t tag) {
30
472k
  return state->internal->section.tags_met & (1u << tag);
31
472k
}
32
33
}  // namespace dec
34
}  // namespace internal
35
}  // namespace brunsli