Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
d0c4402d
Commit
d0c4402d
authored
Mar 23, 2019
by
Simon Giesecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: needless use of macros
Solution: convert streq/strneq into functions
parent
a62e9d35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
testutil.cpp
tests/testutil.cpp
+12
-0
testutil.hpp
tests/testutil.hpp
+2
-2
No files found.
tests/testutil.cpp
View file @
d0c4402d
...
...
@@ -29,6 +29,8 @@
#include "testutil.hpp"
#include "testutil_unity.hpp"
#include <string.h>
const
char
*
SEQ_END
=
(
const
char
*
)
1
;
const
char
bounce_content
[]
=
"12345678ABCDEFGH12345678abcdefgh"
;
...
...
@@ -345,3 +347,13 @@ sockaddr_in bind_bsd_socket (int socket)
return
saddr
;
}
bool
streq
(
const
char
*
lhs
,
const
char
*
rhs
)
{
return
strcmp
(
lhs
,
rhs
)
==
0
;
}
bool
strneq
(
const
char
*
lhs
,
const
char
*
rhs
)
{
return
strcmp
(
lhs
,
rhs
)
!=
0
;
}
tests/testutil.hpp
View file @
d0c4402d
...
...
@@ -150,8 +150,8 @@ int s_send (void *socket_, const char *string_);
// Sends string as 0MQ string, as multipart non-terminal
int
s_sendmore
(
void
*
socket_
,
const
char
*
string_
);
#define streq(s1, s2) (!strcmp ((s1), (s2)))
#define strneq(s1, s2) (strcmp ((s1), (s2)))
bool
streq
(
const
char
*
lhs
,
const
char
*
rhs
);
bool
strneq
(
const
char
*
lhs
,
const
char
*
rhs
);
extern
const
char
*
SEQ_END
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment