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

Tehreer / SheenBidi / 29167177394

11 Jul 2026 08:31PM UTC coverage: 96.086% (-0.09%) from 96.177%
29167177394

push

github

mta452
[lib] Invalidate paragraph user info on attribute changes

2 of 2 new or added lines in 1 file covered. (100.0%)

42 existing lines in 4 files now uncovered.

4051 of 4216 relevant lines covered (96.09%)

444218.68 hits per line

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

85.71
/Source/API/SBTextConfig.c
1
/*
2
 * Copyright (C) 2025-2026 Muhammad Tayyab Akram
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
#include <API/SBBase.h>
18

19
#if SB_TEXT_API_SUPPORTED
20

21
#include <stddef.h>
22

23
#include <API/SBAttributeRegistry.h>
24
#include <Core/Object.h>
25

26
#include "SBTextConfig.h"
27

28
static void FinalizeTextConfig(ObjectRef object)
98✔
29
{
30
    SBTextConfigRef config = object;
98✔
31

32
    if (config->attributeRegistry) {
98✔
33
        SBAttributeRegistryRelease(config->attributeRegistry);
45✔
34
    }
35
}
98✔
36

37
SBTextConfigRef SBTextConfigCreate(void)
98✔
38
{
39
    const SBUInteger size = sizeof(SBTextConfig);
98✔
40
    void *pointer = NULL;
98✔
41
    SBTextConfigRef config;
42

43
    config = ObjectCreate(&size, 1, &pointer, &FinalizeTextConfig);
98✔
44

45
    if (config) {
98✔
46
        config->attributeRegistry = NULL;
98✔
47
        config->baseLevel = SBLevelDefaultLTR;
98✔
48
        config->userInfoCallbacks.retain = NULL;
98✔
49
        config->userInfoCallbacks.release = NULL;
98✔
50
        config->userInfoProvider = NULL;
98✔
51
        config->userInfoProviderContext = NULL;
98✔
52
    }
53

54
    return config;
98✔
55
}
56

57
void SBTextConfigSetAttributeRegistry(SBTextConfigRef config,
47✔
58
    SBAttributeRegistryRef attributeRegistry)
59
{
60
    if (config->attributeRegistry) {
47✔
UNCOV
61
        SBAttributeRegistryRelease(config->attributeRegistry);
×
UNCOV
62
        config->attributeRegistry = NULL;
×
63
    }
64

65
    if (attributeRegistry) {
47✔
66
        config->attributeRegistry = SBAttributeRegistryRetain(attributeRegistry);
45✔
67
    }
68
}
47✔
69

70
void SBTextConfigSetBaseLevel(SBTextConfigRef config, SBLevel baseLevel)
45✔
71
{
72
    config->baseLevel = baseLevel;
45✔
73
}
45✔
74

75
void SBTextConfigSetParagraphUserInfoCallbacks(SBTextConfigRef config,
5✔
76
    const SBParagraphUserInfoCallbacks *callbacks)
77
{
78
    if (callbacks) {
5✔
79
        config->userInfoCallbacks = *callbacks;
5✔
80
    } else {
UNCOV
81
        config->userInfoCallbacks.retain = NULL;
×
UNCOV
82
        config->userInfoCallbacks.release = NULL;
×
83
    }
84
}
5✔
85

86
void SBTextConfigSetParagraphUserInfoProvider(SBTextConfigRef config,
6✔
87
    SBParagraphUserInfoProviderCallback provider, void *context)
88
{
89
    config->userInfoProvider = provider;
6✔
90
    config->userInfoProviderContext = context;
6✔
91
}
6✔
92

UNCOV
93
SBTextConfigRef SBTextConfigRetain(SBTextConfigRef config)
×
94
{
UNCOV
95
    return ObjectRetain((ObjectRef)config);
×
96
}
97

98
void SBTextConfigRelease(SBTextConfigRef config)
98✔
99
{
100
    ObjectRelease((ObjectRef)config);
98✔
101
}
98✔
102

103
#endif
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