Qt-Mocks 0.8.0-alpha.9
Mocking library using Qt Test inspired by Google Test
 
Loading...
Searching...
No Matches
qt_mocks::common_matchers::EqualMatcher< float > Struct Referencefinal

#include <Matchers.hpp>

Inheritance diagram for qt_mocks::common_matchers::EqualMatcher< float >:
Collaboration diagram for qt_mocks::common_matchers::EqualMatcher< float >:

Public Member Functions

bool compare (const float &actual) const override
 Performs an equaliy compairson against a supplied value.
 
bool compare (const float &actual) const override
 When implemented, compares the provided actual value against a predefined condition.
 
::QString description (const float &actual) const override
 Provides a textual description of the current match result.
 
::QString description (const float &actual) const override
 When implemented, provides a textual description of the current match result.
 
- Public Member Functions inherited from qt_mocks::common_matchers::Matcher< float >
 Matcher (const ExpectedValue< float > &value)
 Constructs the object with the given expected value.
 
 Matcher (const Matcher &other)
 Copy constructor that creates a new matcher by copying the state of another matcher.
 
 Matcher (Matcher &&other) noexcept
 Move constructor that initialises the object by transferring the state from another instance.
 
 Matcher (std::unique_ptr< ExpectedValue< float > > expected)
 Constructs the object with the given the expected value object.
 
virtual ~Matcher ()=default
 
const ExpectedValue< float > & expected () const noexcept
 Retrieves the expected value of the matcher.
 
bool hasExpected () const noexcept
 Checks if an expected value is set for the matcher.
 
Matcheroperator= (const Matcher &other)
 Move assignment that changes the object by transferring the state from another instance.
 
Matcheroperator= (Matcher &&other) noexcept
 Move assignment that changes the object by transferring the state from another instance.
 

Additional Inherited Members

- Public Types inherited from qt_mocks::common_matchers::Matcher< float >
using MatcherValueType
 The type of value to match against.
 

Member Function Documentation

◆ compare() [1/2]

bool qt_mocks::common_matchers::EqualMatcher< float >::compare ( const float & actual) const
nodiscardoverridevirtual

Performs an equaliy compairson against a supplied value.

Parameters
actualThe generated value to compare against the expected value.
Returns
Gives true when the actual value and the expected value are the same.

Implements qt_mocks::common_matchers::Matcher< float >.

◆ compare() [2/2]

bool qt_mocks::common_matchers::EqualMatcher< float >::compare ( const float & actual) const
nodiscardoverridevirtual

When implemented, compares the provided actual value against a predefined condition.

This method performs a comparison between the given value and the expected or predefined condition to determine if they match.

Parameters
actualThe value to compare against the predefined condition.
Returns
True if the comparison succeeds; otherwise, false.

Implements qt_mocks::common_matchers::Matcher< float >.

◆ description() [1/2]

::QString qt_mocks::common_matchers::EqualMatcher< float >::description ( const float & actual) const
nodiscardoverridevirtual

Provides a textual description of the current match result.

It generates a human-readable description of the comparison between the expected and actual values, including the expected and actual values themselves.

Parameters
actualThe actual value being matched against.
Returns
The detailed description of the match operation.

Implements qt_mocks::common_matchers::Matcher< float >.

◆ description() [2/2]

::QString qt_mocks::common_matchers::EqualMatcher< float >::description ( const float & actual) const
nodiscardoverridevirtual

When implemented, provides a textual description of the current match result.

It generates a human-readable description of the comparison between the expected and actual values, enabling easier debugging and clear understanding of matcher evaluations.

Parameters
actualThe actual value being matched against.
Returns
The detailed description of the match operation's expectation for successful pass.

Implements qt_mocks::common_matchers::Matcher< float >.