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/09/30 09:52:38 UTC
[trafficserver] 01/02: Fix tests
This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit ebe0a758b53b53e026db31c7c7b58d435de3abbd
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Sat Sep 30 18:01:20 2017 +0900
Fix tests
---
iocore/net/quic/test/Makefile.am | 20 ++++++++
iocore/net/quic/test/test_QUICFlowController.cc | 64 ++++++++++++-------------
2 files changed, 52 insertions(+), 32 deletions(-)
diff --git a/iocore/net/quic/test/Makefile.am b/iocore/net/quic/test/Makefile.am
index a958fe8..917aeeb 100644
--- a/iocore/net/quic/test/Makefile.am
+++ b/iocore/net/quic/test/Makefile.am
@@ -128,6 +128,10 @@ test_QUICFrame_SOURCES = \
../QUICCrypto.cc \
$(QUICCrypto_impl) \
../QUICTypes.cc \
+ ../QUICStream.cc \
+ ../QUICStreamState.cc \
+ ../QUICDebugNames.cc \
+ ../QUICFlowController.cc \
../../SSLNextProtocolSet.cc
test_QUICFrame_LDADD = \
@@ -366,11 +370,20 @@ test_QUICTypeUtil_LDFLAGS = \
@AM_LDFLAGS@
test_QUICTypeUtil_LDADD = \
+ $(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/lib/ts/libtsutil.la
test_QUICTypeUtil_SOURCES = \
main.cc \
test_QUICTypeUtil.cc \
+ ../QUICStream.cc \
+ ../QUICStreamState.cc \
+ ../QUICFlowController.cc \
+ ../QUICDebugNames.cc \
+ ../QUICFrame.cc \
+ ../QUICPacket.cc \
+ ../QUICCrypto.cc \
+ $(QUICCrypto_impl) \
../QUICTypes.cc
#
@@ -394,6 +407,10 @@ test_QUICAckFrameCreator_SOURCES = \
../QUICTypes.cc \
../QUICFrame.cc \
../QUICPacket.cc \
+ ../QUICStream.cc \
+ ../QUICStreamState.cc \
+ ../QUICFlowController.cc \
+ ../QUICDebugNames.cc \
../QUICCrypto.cc \
$(QUICCrypto_impl) \
../../SSLNextProtocolSet.cc
@@ -462,6 +479,9 @@ test_QUICFlowController_SOURCES = \
main.cc \
test_QUICFlowController.cc \
../QUICFlowController.cc \
+ ../QUICStream.cc \
+ ../QUICStreamState.cc \
+ ../QUICDebugNames.cc \
../QUICTypes.cc \
../QUICPacket.cc \
../QUICCrypto.cc \
diff --git a/iocore/net/quic/test/test_QUICFlowController.cc b/iocore/net/quic/test/test_QUICFlowController.cc
index 9c7996b..e98278b 100644
--- a/iocore/net/quic/test/test_QUICFlowController.cc
+++ b/iocore/net/quic/test/test_QUICFlowController.cc
@@ -29,7 +29,7 @@
TEST_CASE("QUICFlowController_Local_Connection", "[quic]")
{
- QUICError error;
+ std::unique_ptr<QUICError> error = nullptr;
MockQUICFrameTransmitter tx;
QUICLocalConnectionFlowController fc(1024, &tx);
@@ -40,35 +40,35 @@ TEST_CASE("QUICFlowController_Local_Connection", "[quic]")
error = fc.update(256);
CHECK(fc.current_offset() == 256);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
error = fc.update(512);
CHECK(fc.current_offset() == 512);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Retransmit
error = fc.update(512);
CHECK(fc.current_offset() == 512);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
error = fc.update(1024);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Delay
error = fc.update(512);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Exceed limit
error = fc.update(1280);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.code == QUICErrorCode::FLOW_CONTROL_ERROR);
+ CHECK(error->code == QUICErrorCode::FLOW_CONTROL_ERROR);
// MAX_STREAM_DATA
CHECK(tx.frameCount[static_cast<int>(QUICFrameType::MAX_DATA)] == 0);
@@ -80,12 +80,12 @@ TEST_CASE("QUICFlowController_Local_Connection", "[quic]")
error = fc.update(1280);
CHECK(fc.current_offset() == 1280);
CHECK(fc.current_limit() == 2048);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
}
TEST_CASE("QUICFlowController_Remote_Connection", "[quic]")
{
- QUICError error;
+ std::unique_ptr<QUICError> error = nullptr;
MockQUICFrameTransmitter tx;
QUICRemoteConnectionFlowController fc(1024, &tx);
@@ -96,36 +96,36 @@ TEST_CASE("QUICFlowController_Remote_Connection", "[quic]")
error = fc.update(256);
CHECK(fc.current_offset() == 256);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
error = fc.update(512);
CHECK(fc.current_offset() == 512);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Retransmit
error = fc.update(512);
CHECK(fc.current_offset() == 512);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
error = fc.update(1024);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Delay
error = fc.update(512);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Exceed limit
CHECK(tx.frameCount[static_cast<int>(QUICFrameType::BLOCKED)] == 0);
error = fc.update(1280);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls != QUICErrorClass::NONE);
+ CHECK(error->cls != QUICErrorClass::NONE);
CHECK(tx.frameCount[static_cast<int>(QUICFrameType::BLOCKED)] == 1);
// MAX_STREAM_DATA
@@ -136,12 +136,12 @@ TEST_CASE("QUICFlowController_Remote_Connection", "[quic]")
error = fc.update(1280);
CHECK(fc.current_offset() == 1280);
CHECK(fc.current_limit() == 2048);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
}
TEST_CASE("QUICFlowController_Local_Stream", "[quic]")
{
- QUICError error;
+ std::unique_ptr<QUICError> error = nullptr;
MockQUICFrameTransmitter tx;
QUICLocalStreamFlowController fc(1024, &tx, 0);
@@ -152,35 +152,35 @@ TEST_CASE("QUICFlowController_Local_Stream", "[quic]")
error = fc.update(256);
CHECK(fc.current_offset() == 256);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
error = fc.update(512);
CHECK(fc.current_offset() == 512);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Retransmit
error = fc.update(512);
CHECK(fc.current_offset() == 512);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
error = fc.update(1024);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Delay
error = fc.update(512);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Exceed limit
error = fc.update(1280);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.code == QUICErrorCode::FLOW_CONTROL_ERROR);
+ CHECK(error->code == QUICErrorCode::FLOW_CONTROL_ERROR);
// MAX_STREAM_DATA
CHECK(tx.frameCount[static_cast<int>(QUICFrameType::MAX_STREAM_DATA)] == 0);
@@ -192,12 +192,12 @@ TEST_CASE("QUICFlowController_Local_Stream", "[quic]")
error = fc.update(1280);
CHECK(fc.current_offset() == 1280);
CHECK(fc.current_limit() == 2048);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
}
TEST_CASE("QUICFlowController_Remote_Stream", "[quic]")
{
- QUICError error;
+ std::unique_ptr<QUICError> error = nullptr;
MockQUICFrameTransmitter tx;
QUICRemoteStreamFlowController fc(1024, &tx, 0);
@@ -208,36 +208,36 @@ TEST_CASE("QUICFlowController_Remote_Stream", "[quic]")
error = fc.update(256);
CHECK(fc.current_offset() == 256);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
error = fc.update(512);
CHECK(fc.current_offset() == 512);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Retransmit
error = fc.update(512);
CHECK(fc.current_offset() == 512);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
error = fc.update(1024);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Delay
error = fc.update(512);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
// Exceed limit
CHECK(tx.frameCount[static_cast<int>(QUICFrameType::STREAM_BLOCKED)] == 0);
error = fc.update(1280);
CHECK(fc.current_offset() == 1024);
CHECK(fc.current_limit() == 1024);
- CHECK(error.cls != QUICErrorClass::NONE);
+ CHECK(error->cls != QUICErrorClass::NONE);
CHECK(tx.frameCount[static_cast<int>(QUICFrameType::STREAM_BLOCKED)] == 1);
// MAX_STREAM_DATA
@@ -248,5 +248,5 @@ TEST_CASE("QUICFlowController_Remote_Stream", "[quic]")
error = fc.update(1280);
CHECK(fc.current_offset() == 1280);
CHECK(fc.current_limit() == 2048);
- CHECK(error.cls == QUICErrorClass::NONE);
+ CHECK(error->cls == QUICErrorClass::NONE);
}
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.