Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
String assertions

Macros

#define cr_assert_str_empty(Value, FormatString, ...)   internal
 
#define cr_expect_str_empty(Value, FormatString, ...)   internal
 
#define cr_assert_str_not_empty(Value, FormatString, ...)   internal
 
#define cr_expect_str_not_empty(Value, FormatString, ...)   internal
 
#define cr_assert_str_eq(Actual, Expected, FormatString, ...)   internal
 
#define cr_expect_str_eq(Actual, Expected, FormatString, ...)   internal
 
#define cr_assert_str_neq(Actual, Unexpected, FormatString, ...)   internal
 
#define cr_expect_str_neq(Actual, Unexpected, FormatString, ...)   internal
 
#define cr_assert_str_lt(Actual, Reference, FormatString, ...)   internal
 
#define cr_expect_str_lt(Actual, Reference, FormatString, ...)   internal
 
#define cr_assert_str_leq(Actual, Reference, FormatString, ...)   internal
 
#define cr_expect_str_leq(Actual, Reference, FormatString, ...)   internal
 
#define cr_assert_str_gt(Actual, Reference, FormatString, ...)   internal
 
#define cr_expect_str_gt(Actual, Reference, FormatString, ...)   internal
 
#define cr_assert_str_geq(Actual, Reference, FormatString, ...)   internal
 
#define cr_expect_str_geq(Actual, Reference, FormatString, ...)   internal
 

Detailed Description

Note
These macros are meant to deal with native strings, i.e. char arrays. Most of them won't work on std::string in C++, with some exceptions – for std::string, you should use regular comparison assersions.

Macro Definition Documentation

◆ cr_assert_str_empty

#define cr_assert_str_empty ( Value,
FormatString,
... )   internal

Passes if Value is an empty string

Passes if Value is an empty string. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Note
Also works on std::string.
Parameters
[in]ValueString to test
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 549 of file assert.h.

◆ cr_assert_str_eq

#define cr_assert_str_eq ( Actual,
Expected,
FormatString,
... )   internal

Passes if Actual is lexicographically equal to Expected

Passes if Actual is lexicographically equal to Expected. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ExpectedExpected String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 618 of file assert.h.

Referenced by Test().

◆ cr_assert_str_geq

#define cr_assert_str_geq ( Actual,
Reference,
FormatString,
... )   internal

Passes if Actual is lexicographically greater or equal to Reference

Passes if Actual is lexicographically greater or equal to Reference. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ReferenceReference String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 783 of file assert.h.

◆ cr_assert_str_gt

#define cr_assert_str_gt ( Actual,
Reference,
FormatString,
... )   internal

Passes if Actual is lexicographically greater than Reference

Passes if Actual is lexicographically greater than Reference. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ReferenceReference String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 750 of file assert.h.

◆ cr_assert_str_leq

#define cr_assert_str_leq ( Actual,
Reference,
FormatString,
... )   internal

Passes if Actual is lexicographically less or equal to Reference

Passes if Actual is lexicographically less or equal to Reference. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ReferenceReference String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 717 of file assert.h.

◆ cr_assert_str_lt

#define cr_assert_str_lt ( Actual,
Reference,
FormatString,
... )   internal

Passes if Actual is lexicographically less than Reference

Passes if Actual is lexicographically less than Reference. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ReferenceReference String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 684 of file assert.h.

◆ cr_assert_str_neq

#define cr_assert_str_neq ( Actual,
Unexpected,
FormatString,
... )   internal

Passes if Actual is not lexicographically equal to Unexpected

Passes if Actual is not lexicographically equal to Unexpected. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]UnexpectedUnexpected String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 651 of file assert.h.

◆ cr_assert_str_not_empty

#define cr_assert_str_not_empty ( Value,
FormatString,
... )   internal

Passes if Value is not an empty string

Passes if Value is not an empty string. Otherwise the test is marked as failure and the execution of the function is aborted.

The optional string is printed on failure.

Note
Also works on std::string.
Parameters
[in]ValueString to test
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 584 of file assert.h.

◆ cr_expect_str_empty

#define cr_expect_str_empty ( Value,
FormatString,
... )   internal

Passes if Value is an empty string

Passes if Value is an empty string. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Note
Also works on std::string.
Parameters
[in]ValueString to test
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 566 of file assert.h.

◆ cr_expect_str_eq

#define cr_expect_str_eq ( Actual,
Expected,
FormatString,
... )   internal

Passes if Actual is lexicographically equal to Expected

Passes if Actual is lexicographically equal to Expected. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ExpectedExpected String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 634 of file assert.h.

◆ cr_expect_str_geq

#define cr_expect_str_geq ( Actual,
Reference,
FormatString,
... )   internal

Passes if Actual is lexicographically greater or equal to Reference

Passes if Actual is lexicographically greater or equal to Reference. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ReferenceReference String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 799 of file assert.h.

◆ cr_expect_str_gt

#define cr_expect_str_gt ( Actual,
Reference,
FormatString,
... )   internal

Passes if Actual is lexicographically greater than Reference

Passes if Actual is lexicographically greater than Reference. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ReferenceReference String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 766 of file assert.h.

◆ cr_expect_str_leq

#define cr_expect_str_leq ( Actual,
Reference,
FormatString,
... )   internal

Passes if Actual is lexicographically less or equal to Reference

Passes if Actual is lexicographically less or equal to Reference. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ReferenceReference String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 733 of file assert.h.

◆ cr_expect_str_lt

#define cr_expect_str_lt ( Actual,
Reference,
FormatString,
... )   internal

Passes if Actual is lexicographically less than Reference

Passes if Actual is lexicographically less than Reference. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]ReferenceReference String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 700 of file assert.h.

◆ cr_expect_str_neq

#define cr_expect_str_neq ( Actual,
Unexpected,
FormatString,
... )   internal

Passes if Actual is not lexicographically equal to Unexpected

Passes if Actual is not lexicographically equal to Unexpected. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Parameters
[in]ActualString to test
[in]UnexpectedUnexpected String
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 667 of file assert.h.

◆ cr_expect_str_not_empty

#define cr_expect_str_not_empty ( Value,
FormatString,
... )   internal

Passes if Value is not an empty string

Passes if Value is not an empty string. Otherwise the test is marked as failure but the execution will continue.

The optional string is printed on failure.

Note
Also works on std::string.
Parameters
[in]ValueString to test
[in]FormatString(optional) printf-like format string
[in]...(optional) format string parameters

Definition at line 601 of file assert.h.