mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Add unit test for other get_word() version
This commit is contained in:
parent
d29160e9de
commit
3f06986896
1 changed files with 14 additions and 0 deletions
14
src/util.cc
14
src/util.cc
|
@ -1223,6 +1223,20 @@ char* get_word(char*& s)
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("util get_word 2")
|
||||||
|
{
|
||||||
|
char orig[10];
|
||||||
|
strcpy(orig, "two words");
|
||||||
|
|
||||||
|
char* a = (char*)orig;
|
||||||
|
const char* b;
|
||||||
|
int blen;
|
||||||
|
|
||||||
|
get_word(9, a, blen, b);
|
||||||
|
CHECK(blen == 3);
|
||||||
|
CHECK(a == b);
|
||||||
|
}
|
||||||
|
|
||||||
void get_word(int length, const char* s, int& pwlen, const char*& pw)
|
void get_word(int length, const char* s, int& pwlen, const char*& pw)
|
||||||
{
|
{
|
||||||
pw = s;
|
pw = s;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue