-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathAssertsVisitor.h
More file actions
46 lines (34 loc) · 1.6 KB
/
AssertsVisitor.h
File metadata and controls
46 lines (34 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2012-2021. All rights reserved.
*/
#ifndef UNITTESTBOT_ASSERTSVISITOR_H
#define UNITTESTBOT_ASSERTSVISITOR_H
#include "AbstractValueViewVisitor.h"
#include "printers/TestsPrinter.h"
#include <unordered_map>
namespace visitor {
class AssertsVisitor : public AbstractValueViewVisitor {
protected:
printer::TestsPrinter *const printer;
struct FunctionSignature {
std::string name;
std::vector<std::string> args;
};
size_t pointerSize;
std::string predicate = "";
static const std::unordered_map<string, string> predicateMapping;
static FunctionSignature processExpect(const types::Type &type,
const std::string >estMacro,
std::vector<std::string> &&args);
[[nodiscard]] std::string getDecorateActualVarName(const string& access);
FunctionSignature changeSignatureToNullCheck(const FunctionSignature &signature,
const types::Type &type,
const tests::AbstractValueView *view,
const string &access);
public:
explicit AssertsVisitor(const types::TypesHandler *typesHandler,
printer::TestsPrinter *printer,
types::PointerUsage usage, const std::optional<LineInfo::PredicateInfo> &predicateInfo);
};
}
#endif // UNITTESTBOT_ASSERTSVISITOR_H