-
Notifications
You must be signed in to change notification settings - Fork 844
Add libswoc unit tests #11106
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
Add libswoc unit tests #11106
Conversation
Adds libswoc unit_tests and updates the lib/swoc/CMakeLists.txt to build them.
ed356a4 to
782b1ca
Compare
782b1ca to
f3308be
Compare
Updating the unit_tests for newer compilers and to make the tests run more generally without assuming they were runned from a particular location.
f3308be to
524087b
Compare
Reverting back IntrusiveHashMap::insert ordering so that it puts things at the end of the list when there is a colision. Fix HttpSessionManager to walk the connection pool backwards.
524087b to
4ffc766
Compare
| if (spot != limit) { | ||
| // If an equal key was found, walk past those to insert at the upper end of the range. | ||
| do { | ||
| spot = H::next_ptr(spot); | ||
| } while (spot != limit && H::equal(key, H::key_of(spot))); | ||
| if (spot != limit) { // something not equal past last equivalent, it's going to be mixed. | ||
| mixed_p = true; | ||
| } | ||
| } |
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.
This puts back what we reverted because origin side session pooling was broken by it. See #10992 where we pulled this out.
To address the functional concerns, see my patch below in HttpSessionManager.cc
| TextView::suffix_at(char c) const { | ||
| self_type zret; | ||
| if (auto n = this->rfind(c); n != npos) { | ||
| if (auto n = this->rfind(c); n != npos && n + 1 < this->size()) { |
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.
This addresses a compiler warning from Centos that zret.assign referenced the byte after data() if n pointed to the last byte in the string.
traeak
left a comment
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.
These all look fine and the reverting of the IPRange and adjustments to HttpSessionManager look fine.
Before this PR, we had pulled in libswoc's production source code into ATS. But we had not done the same with the libswoc unit tests. This ports libswoc unit_tests into ATS and ties it into our cmake system so that they are built and run as a part of ATS unit tests. (cherry picked from commit 20bae7f)
|
Cherry-picked to v10.0.x |
Before this PR, we had pulled in libswoc's production source code into ATS. But we had not done the same with the libswoc unit tests. This ports libswoc unit_tests into ATS and ties it into our cmake system so that they are built and run as a part of ATS unit tests.