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

Side by Side Diff: chrome/browser/media/cast_remoting_connector_fuzzertest.cc

Issue 2714053003: Fix GCC build for target 'all' (Closed)
Patch Set: #if defined(__GNUC__) Created 3 years, 9 months 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/media/cast_remoting_connector_messaging.h" 5 #include "chrome/browser/media/cast_remoting_connector_messaging.h"
6 6
7 // Entry point for LibFuzzer. 7 // Entry point for LibFuzzer.
8 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 8 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
9 // All of the input is used as the text message. 9 // All of the input is used as the text message.
10 const std::string text_message(reinterpret_cast<const char*>(data), size); 10 const std::string text_message(reinterpret_cast<const char*>(data), size);
11 11
12 // Compute an arbitrary, but deterministic "expected session ID." 12 // Compute an arbitrary, but deterministic "expected session ID."
13 const unsigned int session_id = size / 4; 13 const unsigned int session_id = size / 4;
14 14
15 // Make sure the compiler does not try to optimize-away calls by storing their 15 // Make sure the compiler does not try to optimize-away calls by storing their
16 // results in a volatile variable. 16 // results in a volatile variable.
17 volatile unsigned int ignored_result; 17 volatile unsigned int ignored_result;
18 (void)ignored_result;
18 19
19 using Messaging = CastRemotingConnectorMessaging; 20 using Messaging = CastRemotingConnectorMessaging;
20 21
21 if (Messaging::IsMessageForSession( 22 if (Messaging::IsMessageForSession(
22 text_message, Messaging::kStartedStreamsMessageFormatPartial, 23 text_message, Messaging::kStartedStreamsMessageFormatPartial,
23 session_id)) { 24 session_id)) {
24 ignored_result = Messaging::GetStreamIdFromStartedMessage( 25 ignored_result = Messaging::GetStreamIdFromStartedMessage(
25 text_message, Messaging::kStartedStreamsMessageAudioIdSpecifier); 26 text_message, Messaging::kStartedStreamsMessageAudioIdSpecifier);
26 ignored_result = Messaging::GetStreamIdFromStartedMessage( 27 ignored_result = Messaging::GetStreamIdFromStartedMessage(
27 text_message, Messaging::kStartedStreamsMessageVideoIdSpecifier); 28 text_message, Messaging::kStartedStreamsMessageVideoIdSpecifier);
28 } 29 }
29 ignored_result = Messaging::IsMessageForSession( 30 ignored_result = Messaging::IsMessageForSession(
30 text_message, Messaging::kFailedMessageFormat, session_id); 31 text_message, Messaging::kFailedMessageFormat, session_id);
31 ignored_result = Messaging::IsMessageForSession( 32 ignored_result = Messaging::IsMessageForSession(
32 text_message, Messaging::kStoppedMessageFormat, session_id); 33 text_message, Messaging::kStoppedMessageFormat, session_id);
33 34
34 return 0; 35 return 0;
35 } 36 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc ('k') | chrome/browser/previews/previews_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698