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

rieske / trans / 29858613021

21 Jul 2026 06:45PM UTC coverage: 90.602% (-0.1%) from 90.735%
29858613021

Pull #52

github

rieske
Fuzz test and fix issues
Pull Request #52: Fuzz test and fix issues

54 of 72 new or added lines in 7 files covered. (75.0%)

100 existing lines in 4 files now uncovered.

5312 of 5863 relevant lines covered (90.6%)

365676.6 hits per line

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

88.57
/src/ast/FormalArgument.cpp
1
#include "FormalArgument.h"
2

3
#include "AbstractSyntaxTreeVisitor.h"
4

5
namespace ast {
6

7
FormalArgument::FormalArgument(DeclarationSpecifiers specifiers) :
8✔
8
        specifiers { specifiers }
8✔
9
{
10
}
8✔
11

12
FormalArgument::FormalArgument(DeclarationSpecifiers specifiers, std::unique_ptr<Declarator> declarator) :
168✔
13
        specifiers { specifiers },
168✔
14
        declarator { std::move(declarator) }
168✔
15
{
16
}
168✔
17

18
ast::FormalArgument::FormalArgument(FormalArgument&& rhs) :
648✔
19
        specifiers { std::move(rhs.specifiers) },
648✔
20
        declarator { std::move(rhs.declarator) }
1,296✔
21
{
22
}
648✔
23

24
void FormalArgument::accept(AbstractSyntaxTreeVisitor& visitor) {
520✔
25
    visitor.visit(*this);
520✔
26
}
520✔
27

28
void FormalArgument::visitSpecifiers(AbstractSyntaxTreeVisitor& visitor) {
348✔
29
    specifiers.accept(visitor);
348✔
30
}
348✔
31

32
void FormalArgument::visitDeclarator(AbstractSyntaxTreeVisitor& visitor) {
520✔
33
    if (declarator) {
520✔
34
        declarator->accept(visitor);
502✔
35
    }
36
}
520✔
37

38
type::Type FormalArgument::getType() const {
348✔
39
    // FIXME: terribly wrong
40
    auto baseType = specifiers.getTypeSpecifiers().at(0).getType();
348✔
41
    if (!declarator) {
348✔
42
        // Abstract parameter: `int f(int)` — type only, no name/declarator.
43
        return baseType;
12✔
44
    }
45
    return declarator->getFundamentalType(baseType);
336✔
46
}
348✔
47

48
std::string FormalArgument::getName() const {
174✔
49
    return declarator ? declarator->getName() : "";
186✔
50
}
51

52
translation_unit::Context FormalArgument::getDeclarationContext() const {
×
NEW
53
    if (declarator) {
×
NEW
54
        return declarator->getContext();
×
55
    }
NEW
56
    return translation_unit::Context { "", 0 };
×
57
}
58

59
bool FormalArgument::isVoid() const {
54✔
60
    return !declarator && specifiers.getTypeSpecifiers().at(0).getType().isVoid();
54✔
61
}
62

63
} // namespace ast
64

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc