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

eranpeer / FakeIt / 4588732768

pending completion
4588732768

push

github

GitHub
Merge pull request #312 from eranpeer/fix-msvc-spy-and-dtor-mock

4020 of 4023 relevant lines covered (99.93%)

120.58 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() {
556✔
24
            static std::atomic_uint invocationOrdinal{0};
25
            return ++invocationOrdinal;
556✔
26
        }
27

28
        struct Matcher {
29

30
            virtual ~Matcher() FAKEIT_THROWS {
712✔
31
            }
712✔
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) :
556✔
39
                _ordinal(ordinal), _method(method), _isVerified(false) {
556✔
40
        }
556✔
41

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

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

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

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

56
        bool isVerified() const {
67✔
57
            return _isVerified;
67✔
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