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

eranpeer / FakeIt / 4715147296

pending completion
4715147296

push

github

Franck W
Improved UBSAN support for gcc too + added a macro to disable tests that have to trigger UBSAN.

4029 of 4032 relevant lines covered (99.93%)

123.64 hits per line

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

94.44
/include/fakeit/Invocation.hpp
1
/*
2
 * Copyright (c) 2014 Eran Pe'er.
3
 *
4
 * This program is made available under the terms of the MIT License.
5
 *
6
 * Created on Mar 10, 2014
7
 */
8
#pragma once
9

10
#include <typeinfo>
11
#include <tuple>
12
#include <string>
13
#include <iosfwd>
14
#include <sstream>
15

16
#include "fakeit/DomainObjects.hpp"
17
#include "mockutils/Destructible.hpp"
18

19
namespace fakeit {
20

21
    struct Invocation : Destructible {
×
22

23
        static unsigned int nextInvocationOrdinal() {
565✔
24
            static std::atomic_uint invocationOrdinal{0};
25
            return ++invocationOrdinal;
565✔
26
        }
27

28
        struct Matcher {
29

30
            virtual ~Matcher() FAKEIT_THROWS {
730✔
31
            }
730✔
32

33
            virtual bool matches(Invocation &invocation) = 0;
34

35
            virtual std::string format() const = 0;
36
        };
37

38
        Invocation(unsigned int ordinal, MethodInfo &method) :
565✔
39
                _ordinal(ordinal), _method(method), _isVerified(false) {
565✔
40
        }
565✔
41

42
        virtual ~Invocation() override = default;
565✔
43

44
        unsigned int getOrdinal() const {
3,348✔
45
            return _ordinal;
3,348✔
46
        }
47

48
        MethodInfo &getMethod() const {
829✔
49
            return _method;
829✔
50
        }
51

52
        void markAsVerified() {
379✔
53
            _isVerified = true;
379✔
54
        }
379✔
55

56
        bool isVerified() const {
76✔
57
            return _isVerified;
76✔
58
        }
59

60
        virtual std::string format() const = 0;
61

62
    private:
63
        const unsigned int _ordinal;
64
        MethodInfo &_method;
65
        bool _isVerified;
66
    };
67

68
}
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