You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2017/12/26 00:55:38 UTC
[trafficserver] branch quic-latest updated: Fix build errors of
unit tests (tests for QUICLossDetector is FAIL)
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/quic-latest by this push:
new cba3193 Fix build errors of unit tests (tests for QUICLossDetector is FAIL)
cba3193 is described below
commit cba3193ceadadde8612966b657fd54138a8bb5ee
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Tue Dec 26 09:52:44 2017 +0900
Fix build errors of unit tests (tests for QUICLossDetector is FAIL)
---
iocore/net/quic/Mock.h | 17 ++++-------------
iocore/net/quic/test/test_QUICFrameDispatcher.cc | 11 +++--------
2 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h
index ff68b77..b66074a 100644
--- a/iocore/net/quic/Mock.h
+++ b/iocore/net/quic/Mock.h
@@ -20,10 +20,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "P_Net.h"
#include "QUICApplication.h"
#include "QUICStreamManager.h"
-#include "QUICCongestionController.h"
#include "QUICLossDetector.h"
#include "QUICEvents.h"
#include "QUICPacketTransmitter.h"
@@ -327,20 +327,11 @@ class MockQUICCongestionController : public QUICCongestionController
{
public:
// Override
- virtual QUICErrorUPtr
- handle_frame(std::shared_ptr<const QUICFrame> f) override
- {
- ++_frameCount[static_cast<int>(f->type())];
- ++_totalFrameCount;
-
- return QUICErrorUPtr(new QUICNoError());
- }
-
virtual void
- on_packets_lost(std::set<QUICPacketNumber> packets) override
+ on_packets_lost(std::map<QUICPacketNumber, PacketInfo &> packets) override
{
- for (auto pn : packets) {
- lost_packets.insert(pn);
+ for (auto &p : packets) {
+ lost_packets.insert(p.first);
}
}
diff --git a/iocore/net/quic/test/test_QUICFrameDispatcher.cc b/iocore/net/quic/test/test_QUICFrameDispatcher.cc
index 215303f..5d90c77 100644
--- a/iocore/net/quic/test/test_QUICFrameDispatcher.cc
+++ b/iocore/net/quic/test/test_QUICFrameDispatcher.cc
@@ -35,20 +35,17 @@ TEST_CASE("QUICFrameHandler", "[quic]")
QUICStreamFrame streamFrame(std::move(payload), 1, 0x03, 0);
- auto connection = new MockQUICConnection();
- auto streamManager = new MockQUICStreamManager();
- auto congestionController = new MockQUICCongestionController();
- auto lossDetector = new MockQUICLossDetector();
+ auto connection = new MockQUICConnection();
+ auto streamManager = new MockQUICStreamManager();
+ auto lossDetector = new MockQUICLossDetector();
QUICFrameDispatcher quicFrameDispatcher;
quicFrameDispatcher.add_handler(connection);
quicFrameDispatcher.add_handler(streamManager);
- quicFrameDispatcher.add_handler(congestionController);
quicFrameDispatcher.add_handler(lossDetector);
// Initial state
CHECK(connection->getTotalFrameCount() == 0);
CHECK(streamManager->getTotalFrameCount() == 0);
- CHECK(congestionController->getTotalFrameCount() == 0);
// STREAM frame
uint8_t buf[4096] = {0};
@@ -58,7 +55,6 @@ TEST_CASE("QUICFrameHandler", "[quic]")
quicFrameDispatcher.receive_frames(buf, len, should_send_ack);
CHECK(connection->getTotalFrameCount() == 0);
CHECK(streamManager->getTotalFrameCount() == 1);
- CHECK(congestionController->getTotalFrameCount() == 1);
// CONNECTION_CLOSE frame
QUICConnectionCloseFrame connectionCloseFrame({});
@@ -66,5 +62,4 @@ TEST_CASE("QUICFrameHandler", "[quic]")
quicFrameDispatcher.receive_frames(buf, len, should_send_ack);
CHECK(connection->getTotalFrameCount() == 1);
CHECK(streamManager->getTotalFrameCount() == 1);
- CHECK(congestionController->getTotalFrameCount() == 1);
}
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].