Merge branch 'master' of ssh://barant.com/git/CoreUtils

This commit is contained in:
Brad Arant 2022-08-05 06:18:59 -07:00
commit 36348aba17
5 changed files with 15 additions and 3 deletions

View File

@ -69,12 +69,16 @@ namespace coreutils {
}
bool ZString::operator!=(const ZString &valuex) const {
return (strncmp(data, valuex.data, valuex.length <= length ? valuex.length : length) != 0);
// if(length != valuex.getLength())
// return false;
return (strncmp(data, valuex.data, length) != 0);
}
bool ZString::operator!=(const char *valuex) const {
size_t len = strlen(valuex);
return (strncmp(data, valuex, len <= length ? len : length) != 0);
if(length != len)
return true;
return (strncmp(data, valuex, length) != 0);
}
std::vector<ZString> &ZString::getList() {

View File

@ -1,2 +1,3 @@
#!/bin/bash
g++ -o mstring_test mstring_test.cpp -I.. -L.. -lCoreUtils
g++ -o zstring_test zstring_test.cpp -I.. -L.. -lCoreUtils
g++ -o mstring_test mstring_test.cpp -I.. -L.. -lCoreUtils

Binary file not shown.

Binary file not shown.

View File

@ -3,6 +3,13 @@
int main(int argc, char **argv) {
// Test comparison operations.
coreutils::ZString test1("");
std::cout << (test1 != ".");
// Test split operations.
coreutils::ZString test("11111:22222:33333:44444");
std::cout << "test pre-split: [" << test << "]." << std::endl;