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

realm / realm-core / github_pull_request_281750

30 Oct 2023 03:37PM UTC coverage: 90.528% (-1.0%) from 91.571%
github_pull_request_281750

Pull #6073

Evergreen

jedelbo
Log free space and history sizes when opening file
Pull Request #6073: Merge next-major

95488 of 175952 branches covered (0.0%)

8973 of 12277 new or added lines in 149 files covered. (73.09%)

622 existing lines in 51 files now uncovered.

233503 of 257934 relevant lines covered (90.53%)

6533720.56 hits per line

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

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

19
#include <realm/impl/transact_log.hpp>
20
#include <realm/util/overload.hpp>
21

22
namespace realm::_impl {
23

24

25
bool TransactLogEncoder::select_table(TableKey key)
26
{
1,390,281✔
27
    size_t levels = 0;
1,390,281✔
28
    append_simple_instr(instr_SelectTable, levels, key.value); // Throws
1,390,281✔
29
    return true;
1,390,281✔
30
}
1,390,281✔
31

32
bool TransactLogEncoder::select_collection(ColKey col_key, ObjKey key, const StablePath& path)
33
{
272,316✔
34
    auto path_size = path.size();
272,316✔
35
    if (path_size > 1) {
272,316✔
36
        append_simple_instr(instr_SelectCollectionByPath, col_key, key.value);
390✔
37
        append_simple_instr(path_size - 1);
390✔
38

195✔
39
        for (size_t n = 1; n < path_size; n++) {
828✔
40
            append_simple_instr(path[n].get_salt());
438✔
41
        }
438✔
42
    }
390✔
43
    else {
271,926✔
44
        append_simple_instr(instr_SelectCollection, col_key, key.value); // Throws
271,926✔
45
    }
271,926✔
46
    return true;
272,316✔
47
}
272,316✔
48

49
void TransactLogEncoder::encode_string(StringData string)
NEW
50
{
×
NEW
51
    size_t max_required_bytes = max_enc_bytes_per_int + string.size();
×
NEW
52
    char* ptr = reserve(max_required_bytes); // Throws
×
NEW
53
    ptr = encode(ptr, size_t(string.size()));
×
NEW
54
    ptr = std::copy(string.data(), string.data() + string.size(), ptr);
×
NEW
55
    advance(ptr);
×
NEW
56
}
×
57

58
REALM_NORETURN
59
void TransactLogParser::parser_error() const
60
{
×
61
    throw Exception(ErrorCodes::BadChangeset, "Bad transaction log");
×
62
}
×
63

64
} // namespace realm::_impl
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