-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add gtest, fix string trim function crash #42
Conversation
加上单测? |
GTest那套吗 |
你看吧,能加就加,不能加就以后再说。 |
我周末看一下, 好加的话 就加了 |
加入 GTest 单测, 添加部分测试用例, 修复 现在单测还没有集成到 GitHub CI中, 下一步再集成到 GitHub CI中 |
src/pstd/pstd_string.cc
Outdated
} | ||
return ori.substr(pos, rpos - pos + 1); | ||
return std::move(ori.substr(begin, ori.size() - begin)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的std::move应该是不必要的吧,编译器会通过RVO来处理返回的值
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
编译器应该是可以自动优化的, 但是我之前问gpt, 跟我说了一堆东西, 我不放心 就把 move加上了, 等明天我再确认一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的std::move应该是不必要的吧,编译器会通过RVO来处理返回的值
编译器确实可以自动使用RVO优化, 没有必要move 👍👍
macos CI 还是失败了 |
今天早上发现有冲突了, 在网页上解了没弄好, 又个文件没弄过来,等晚上回去弄一下 |
还有问题, rocksdb中依赖了gtest, 项目引入的gtest冲突了, 原本以为改一下rocksdb的cmake能解决, 测试了一下, 那样只是没有编译rocksdb, 实际还是没有解决这个依赖冲突问题 |
* fix string trim function crash * add gtest * add timestamp test,fix Random range error * Optimized trim function,add TrimLeft and TrimRight * fix StringTrimRight range error * Resolve rocksdb and gtest dependency conflicts * fix rocksdb and gtest dependency conflicts,Streamlined rocksdb compilation
修复 pstd::StringTrim 函数 可能出现的崩溃