Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: net/udp/udp_socket_unittest.cc

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_auth_sspi_win_unittest.cc ('k') | printing/printing_context_win_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/udp/udp_socket.h" 5 #include "net/udp/udp_socket.h"
6 6
7 #include "net/udp/udp_client_socket.h" 7 #include "net/udp/udp_client_socket.h"
8 #include "net/udp/udp_server_socket.h" 8 #include "net/udp/udp_server_socket.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 QOS_TRAFFIC_TYPE g_expected_traffic_type; 708 QOS_TRAFFIC_TYPE g_expected_traffic_type;
709 709
710 BOOL WINAPI FakeQOSAddSocketToFlow(HANDLE handle, 710 BOOL WINAPI FakeQOSAddSocketToFlow(HANDLE handle,
711 SOCKET socket, 711 SOCKET socket,
712 PSOCKADDR addr, 712 PSOCKADDR addr,
713 QOS_TRAFFIC_TYPE traffic_type, 713 QOS_TRAFFIC_TYPE traffic_type,
714 DWORD flags, 714 DWORD flags,
715 PQOS_FLOWID flow_id) { 715 PQOS_FLOWID flow_id) {
716 EXPECT_EQ(kFakeHandle, handle); 716 EXPECT_EQ(kFakeHandle, handle);
717 EXPECT_EQ(NULL, addr); 717 EXPECT_EQ(NULL, addr);
718 EXPECT_EQ(QOS_NON_ADAPTIVE_FLOW, flags); 718 EXPECT_EQ(static_cast<DWORD>(QOS_NON_ADAPTIVE_FLOW), flags);
719 EXPECT_EQ(0, *flow_id); 719 EXPECT_EQ(0u, *flow_id);
720 *flow_id = kFakeFlowId; 720 *flow_id = kFakeFlowId;
721 return true; 721 return true;
722 } 722 }
723 723
724 BOOL WINAPI FakeQOSRemoveSocketFromFlow(HANDLE handle, 724 BOOL WINAPI FakeQOSRemoveSocketFromFlow(HANDLE handle,
725 SOCKET socket, 725 SOCKET socket,
726 QOS_FLOWID flowid, 726 QOS_FLOWID flowid,
727 DWORD reserved) { 727 DWORD reserved) {
728 EXPECT_EQ(kFakeHandle, handle); 728 EXPECT_EQ(kFakeHandle, handle);
729 EXPECT_EQ(NULL, socket); 729 EXPECT_EQ(0u, socket);
730 EXPECT_EQ(kFakeFlowId, flowid); 730 EXPECT_EQ(kFakeFlowId, flowid);
731 EXPECT_EQ(0, reserved); 731 EXPECT_EQ(0u, reserved);
732 return true; 732 return true;
733 } 733 }
734 734
735 DWORD g_expected_dscp; 735 DWORD g_expected_dscp;
736 736
737 BOOL WINAPI FakeQOSSetFlow(HANDLE handle, 737 BOOL WINAPI FakeQOSSetFlow(HANDLE handle,
738 QOS_FLOWID flow_id, 738 QOS_FLOWID flow_id,
739 QOS_SET_FLOW op, 739 QOS_SET_FLOW op,
740 ULONG size, 740 ULONG size,
741 PVOID data, 741 PVOID data,
742 DWORD reserved, 742 DWORD reserved,
743 LPOVERLAPPED overlapped) { 743 LPOVERLAPPED overlapped) {
744 EXPECT_EQ(kFakeHandle, handle); 744 EXPECT_EQ(kFakeHandle, handle);
745 EXPECT_EQ(QOSSetOutgoingDSCPValue, op); 745 EXPECT_EQ(QOSSetOutgoingDSCPValue, op);
746 EXPECT_EQ(sizeof(DWORD), size); 746 EXPECT_EQ(sizeof(DWORD), size);
747 EXPECT_EQ(g_expected_dscp, *reinterpret_cast<DWORD*>(data)); 747 EXPECT_EQ(g_expected_dscp, *reinterpret_cast<DWORD*>(data));
748 EXPECT_EQ(kFakeFlowId, flow_id); 748 EXPECT_EQ(kFakeFlowId, flow_id);
749 EXPECT_EQ(0, reserved); 749 EXPECT_EQ(0u, reserved);
750 EXPECT_EQ(NULL, overlapped); 750 EXPECT_EQ(NULL, overlapped);
751 return true; 751 return true;
752 } 752 }
753 753
754 } // namespace 754 } // namespace
755 755
756 // Mock out the Qwave functions and make sure they are 756 // Mock out the Qwave functions and make sure they are
757 // called correctly. Must be in net namespace for friendship 757 // called correctly. Must be in net namespace for friendship
758 // reasons. 758 // reasons.
759 TEST_F(UDPSocketTest, SetDSCPFake) { 759 TEST_F(UDPSocketTest, SetDSCPFake) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 g_expected_traffic_type = QOSTrafficTypeExcellentEffort; 798 g_expected_traffic_type = QOSTrafficTypeExcellentEffort;
799 EXPECT_EQ(OK, client.SetDiffServCodePoint(DSCP_NO_CHANGE)); 799 EXPECT_EQ(OK, client.SetDiffServCodePoint(DSCP_NO_CHANGE));
800 g_expected_dscp = DSCP_DEFAULT; 800 g_expected_dscp = DSCP_DEFAULT;
801 g_expected_traffic_type = QOSTrafficTypeBestEffort; 801 g_expected_traffic_type = QOSTrafficTypeBestEffort;
802 EXPECT_EQ(OK, client.SetDiffServCodePoint(DSCP_DEFAULT)); 802 EXPECT_EQ(OK, client.SetDiffServCodePoint(DSCP_DEFAULT));
803 client.Close(); 803 client.Close();
804 } 804 }
805 #endif 805 #endif
806 806
807 } // namespace net 807 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_sspi_win_unittest.cc ('k') | printing/printing_context_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698