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

paticcaa / pain / 17369090488

01 Sep 2025 06:05AM UTC coverage: 55.914% (+12.3%) from 43.591%
17369090488

push

github

ivanallen
fix deva test

Signed-off-by: allen <1007729991@qq.com>

1345 of 3215 branches covered (41.84%)

Branch coverage included in aggregate %.

11 of 12 new or added lines in 4 files covered. (91.67%)

1586 of 2027 relevant lines covered (78.24%)

409.05 hits per line

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

38.46
/src/deva/container_op.cc
1
#include "deva/container_op.h"
2
#include <pain/base/types.h>
3
#include <boost/assert.hpp>
4
#include "pain/proto/deva_store.pb.h"
5
#include "deva/deva.h"
6

7
namespace pain::deva {
8

9
template <OpType OpType, typename Request, typename Response>
10
OpPtr create(RsmPtr rsm) {
4✔
11
    Request request;
4!
12
    OpPtr op = nullptr;
4✔
13

14
    if constexpr (static_cast<int>(OpType) < 100) { // NOLINT(readability-magic-numbers)
15
        op = new ContainerOp<Deva, Request, Response>(OpType, rsm, request, nullptr);
4!
16
    }
17
    return op;
8✔
18
}
4✔
19

20
#define BRANCH(name)                                                                                                   \
21
    case OpType::k##name:                                                                                              \
22
        return create<OpType::k##name, proto::deva::store::name##Request, proto::deva::store::name##Response>(rsm);    \
23
        break;
24

25
OpPtr decode(OpType op_type, IOBuf* buf, RsmPtr rsm) {
4✔
26
    auto op = [](OpType op_type, IOBuf* buf, RsmPtr rsm) -> OpPtr {
4✔
27
        switch (op_type) {
4!
28
            BRANCH(CreateFile)
2!
29
            BRANCH(CreateDir)
2!
30
            BRANCH(RemoveFile)
×
31
            BRANCH(SealFile)
×
32
            BRANCH(CreateChunk)
×
33
            BRANCH(CheckInChunk)
×
34
            BRANCH(SealChunk)
×
35
            BRANCH(SealAndNewChunk)
×
36
        default:
×
NEW
37
            BOOST_ASSERT_MSG(false, fmt::format("unknown op type: {}", op_type).c_str());
×
38
        }
39
        return nullptr;
×
40
    }(op_type, buf, rsm);
4!
41
    op->decode(buf);
4!
42
    return op;
4✔
43
}
×
44

45
#undef BRANCH
46

47
} // namespace pain::deva
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