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

bblanchon / ArduinoJson / 4766013433

pending completion
4766013433

push

github

Benoit Blanchon
Increase coverage

8 of 8 new or added lines in 3 files covered. (100.0%)

3321 of 3342 relevant lines covered (99.37%)

6648.12 hits per line

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

100.0
/src/ArduinoJson/Collection/CollectionData.hpp
1
// ArduinoJson - https://arduinojson.org
2
// Copyright © 2014-2023, Benoit BLANCHON
3
// MIT License
4

5
#pragma once
6

7
#include <ArduinoJson/Namespace.hpp>
8
#include <ArduinoJson/Polyfills/assert.hpp>
9

10
#include <stddef.h>  // size_t
11

12
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
13

14
class VariantData;
15
class VariantSlot;
16

17
class CollectionData {
18
  VariantSlot* _head;
19
  VariantSlot* _tail;
20

21
 public:
22
  void clear();
23
  size_t memoryUsage() const;
24
  size_t size() const;
25

26
  void add(VariantSlot*);
27
  void remove(VariantSlot* slot);
28

29
  VariantSlot* head() const {
1,706✔
30
    return _head;
1,706✔
31
  }
32

33
  void movePointers(ptrdiff_t variantDistance);
34

35
  VariantSlot* get(size_t index) const;
36

37
  template <typename TAdaptedString>
38
  VariantSlot* get(TAdaptedString key) const;
39

40
 private:
41
  VariantSlot* getPrevious(VariantSlot*) const;
42
};
43

44
inline const VariantData* collectionToVariant(
270✔
45
    const CollectionData* collection) {
46
  const void* data = collection;  // prevent warning cast-align
270✔
47
  return reinterpret_cast<const VariantData*>(data);
270✔
48
}
49

50
inline VariantData* collectionToVariant(CollectionData* collection) {
1,207✔
51
  void* data = collection;  // prevent warning cast-align
1,207✔
52
  return reinterpret_cast<VariantData*>(data);
1,207✔
53
}
54

55
ARDUINOJSON_END_PRIVATE_NAMESPACE
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

© 2025 Coveralls, Inc