summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-18 20:40:04 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-18 20:40:04 +0000
commit4fa725ecd63006b46f2693f219a10a7c62e1a617 (patch)
tree90aa4f8d5725c623fd7ecd068cafca3b819b87af /net
parent2b799eee4408951d90d1c6be505491c2f40f5673 (diff)
downloadchromium_src-4fa725ecd63006b46f2693f219a10a7c62e1a617.zip
chromium_src-4fa725ecd63006b46f2693f219a10a7c62e1a617.tar.gz
chromium_src-4fa725ecd63006b46f2693f219a10a7c62e1a617.tar.bz2
Make some net unittests compile and pass on linux.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/SConscript28
-rw-r--r--net/base/bzip2_filter_unittest.cc7
-rw-r--r--net/base/gzip_filter_unittest.cc9
3 files changed, 21 insertions, 23 deletions
diff --git a/net/SConscript b/net/SConscript
index 2e12a13..699f669 100644
--- a/net/SConscript
+++ b/net/SConscript
@@ -52,15 +52,18 @@ env.Append(
# These net files work on *all* platforms; files that don't work
# cross-platforom live below.
input_files = [
+ 'base/auth_cache.cc',
+ 'base/base64.cc',
+ 'base/bzip2_filter.cc',
+ 'base/filter.cc',
+ 'base/gzip_filter.cc',
+ 'base/gzip_header.cc',
'base/net_errors.cc',
]
if env['PLATFORM'] == 'win32':
input_files.extend([
'base/address_list.cc',
- 'base/auth_cache.cc',
- 'base/base64.cc',
- 'base/bzip2_filter.cc',
'base/client_socket_factory.cc',
'base/client_socket_handle.cc',
'base/client_socket_pool.cc',
@@ -71,9 +74,6 @@ if env['PLATFORM'] == 'win32':
'base/dns_resolution_observer.cc',
'base/escape.cc',
'base/ev_root_ca_metadata.cc',
- 'base/filter.cc',
- 'base/gzip_filter.cc',
- 'base/gzip_header.cc',
'base/host_resolver.cc',
'base/listen_socket.cc',
'base/mime_sniffer.cc',
@@ -152,7 +152,7 @@ if env['PLATFORM'] in ('darwin', 'posix'):
# Not quite ready for these, they still pull in net_util.h which
# includes <windows.h>.
#'disk_cache/cache_util_posix.cc',
- #'disk_cache/file_win.cc_posix',
+ #'disk_cache/file_posix.cc',
#'disk_cache/mapped_file_posix.cc',
#'disk_cache/os_file_posix.cc',
])
@@ -179,14 +179,14 @@ env_tests.Prepend(
'UNIT_TEST',
],
LIBS = [
- 'googleurl',
+ 'bzip2', # Due to gcc's link order, bzip2 must come before base.
'base',
+ 'googleurl',
'gtest',
- 'bzip2',
'icuuc',
+ 'net', # Likewise, net must come before modp_b64.
'modp_b64',
'zlib',
- 'net',
]
)
@@ -222,21 +222,21 @@ if env['PLATFORM'] == 'win32':
unittest_files = [
+ 'base/auth_cache_unittest.cc',
+ 'base/base64_unittest.cc',
+ 'base/bzip2_filter_unittest.cc',
+ 'base/gzip_filter_unittest.cc',
'$BASE_DIR/run_all_unittests$OBJSUFFIX',
]
if env['PLATFORM'] == 'win32':
unittest_files.extend([
- 'base/auth_cache_unittest.cc',
- 'base/base64_unittest.cc',
- 'base/bzip2_filter_unittest.cc',
'base/client_socket_pool_unittest.cc',
'base/cookie_monster_unittest.cc',
'base/cookie_policy_unittest.cc',
'base/data_url_unittest.cc',
'base/directory_lister_unittest.cc',
'base/escape_unittest.cc',
- 'base/gzip_filter_unittest.cc',
'base/mime_sniffer_unittest.cc',
'base/mime_util_unittest.cc',
'base/net_util_unittest.cc',
diff --git a/net/base/bzip2_filter_unittest.cc b/net/base/bzip2_filter_unittest.cc
index 5196e62..a9a124f 100644
--- a/net/base/bzip2_filter_unittest.cc
+++ b/net/base/bzip2_filter_unittest.cc
@@ -27,8 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "minmax.h"
-
#include <fstream>
#include <iostream>
@@ -140,14 +138,15 @@ class BZip2FilterUnitTest : public testing::Test {
int encode_data_len;
if (get_extra_data && !encode_avail_size)
break;
- encode_data_len = min(encode_avail_size, filter->stream_buffer_size());
+ encode_data_len = std::min(encode_avail_size,
+ filter->stream_buffer_size());
memcpy(filter->stream_buffer(), encode_next, encode_data_len);
filter->FlushStreamBuffer(encode_data_len);
encode_next += encode_data_len;
encode_avail_size -= encode_data_len;
while (1) {
- int decode_data_len = min(decode_avail_size, output_buffer_size);
+ int decode_data_len = std::min(decode_avail_size, output_buffer_size);
code = filter->ReadFilteredData(decode_next, &decode_data_len);
decode_next += decode_data_len;
diff --git a/net/base/gzip_filter_unittest.cc b/net/base/gzip_filter_unittest.cc
index 911bd4e..11fd9d2 100644
--- a/net/base/gzip_filter_unittest.cc
+++ b/net/base/gzip_filter_unittest.cc
@@ -27,8 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "minmax.h"
-
#include <fstream>
#include <iostream>
@@ -192,14 +190,15 @@ class GZipUnitTest : public testing::Test {
int code = Filter::FILTER_OK;
while (code != Filter::FILTER_DONE) {
int encode_data_len;
- encode_data_len = min(encode_avail_size, filter->stream_buffer_size());
+ encode_data_len = std::min(encode_avail_size,
+ filter->stream_buffer_size());
memcpy(filter->stream_buffer(), encode_next, encode_data_len);
filter->FlushStreamBuffer(encode_data_len);
encode_next += encode_data_len;
encode_avail_size -= encode_data_len;
while (1) {
- int decode_data_len = min(decode_avail_size, output_buffer_size);
+ int decode_data_len = std::min(decode_avail_size, output_buffer_size);
code = filter->ReadFilteredData(decode_next, &decode_data_len);
decode_next += decode_data_len;
@@ -372,7 +371,7 @@ TEST_F(GZipUnitTest, DecodeMissingData) {
corrupt_decode_buffer, &corrupt_decode_size);
// Expect failures
- EXPECT_TRUE(code == Filter::FILTER_ERROR);
+ EXPECT_EQ(Filter::FILTER_ERROR, code);
}
// Decoding gzip stream with corrupted header.