mirror of https://github.com/grpc/grpc.git
Merge pull request #6147 from ctiller/strong-includes
Rollup of changes from latest importpull/6259/head
commit
241dea56c8
49 changed files with 845 additions and 900 deletions
@ -0,0 +1,67 @@ |
|||||||
|
/*
|
||||||
|
* |
||||||
|
* Copyright 2016, Google Inc. |
||||||
|
* All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are |
||||||
|
* met: |
||||||
|
* |
||||||
|
* * Redistributions of source code must retain the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer. |
||||||
|
* * Redistributions in binary form must reproduce the above |
||||||
|
* copyright notice, this list of conditions and the following disclaimer |
||||||
|
* in the documentation and/or other materials provided with the |
||||||
|
* distribution. |
||||||
|
* * Neither the name of Google Inc. nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* |
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||||
|
* (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 <grpc++/support/config_protobuf.h> |
||||||
|
|
||||||
|
#include "test/cpp/qps/parse_json.h" |
||||||
|
|
||||||
|
#include <string> |
||||||
|
|
||||||
|
#include <google/protobuf/util/json_util.h> |
||||||
|
#include <google/protobuf/util/type_resolver_util.h> |
||||||
|
#include <grpc/support/log.h> |
||||||
|
|
||||||
|
namespace grpc { |
||||||
|
namespace testing { |
||||||
|
|
||||||
|
void ParseJson(const grpc::string& json, const grpc::string& type, |
||||||
|
GRPC_CUSTOM_MESSAGE* msg) { |
||||||
|
std::unique_ptr<google::protobuf::util::TypeResolver> type_resolver( |
||||||
|
google::protobuf::util::NewTypeResolverForDescriptorPool( |
||||||
|
"type.googleapis.com", |
||||||
|
google::protobuf::DescriptorPool::generated_pool())); |
||||||
|
grpc::string binary; |
||||||
|
auto status = JsonToBinaryString( |
||||||
|
type_resolver.get(), "type.googleapis.com/" + type, json, &binary); |
||||||
|
if (!status.ok()) { |
||||||
|
grpc::string errmsg(status.error_message()); |
||||||
|
gpr_log(GPR_ERROR, "Failed to convert json to binary: errcode=%d msg=%s", |
||||||
|
status.error_code(), errmsg.c_str()); |
||||||
|
gpr_log(GPR_ERROR, "JSON: ", json.c_str()); |
||||||
|
abort(); |
||||||
|
} |
||||||
|
GPR_ASSERT(msg->ParseFromString(binary)); |
||||||
|
} |
||||||
|
|
||||||
|
} // testing
|
||||||
|
} // grpc
|
@ -0,0 +1,49 @@ |
|||||||
|
/*
|
||||||
|
* |
||||||
|
* Copyright 2016, Google Inc. |
||||||
|
* All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are |
||||||
|
* met: |
||||||
|
* |
||||||
|
* * Redistributions of source code must retain the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer. |
||||||
|
* * Redistributions in binary form must reproduce the above |
||||||
|
* copyright notice, this list of conditions and the following disclaimer |
||||||
|
* in the documentation and/or other materials provided with the |
||||||
|
* distribution. |
||||||
|
* * Neither the name of Google Inc. nor the names of its |
||||||
|
* contributors may be used to endorse or promote products derived from |
||||||
|
* this software without specific prior written permission. |
||||||
|
* |
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifndef TEST_QPS_PARSE_JSON_H |
||||||
|
#define TEST_QPS_PARSE_JSON_H |
||||||
|
|
||||||
|
#include <grpc++/support/config.h> |
||||||
|
#include <grpc++/support/config_protobuf.h> |
||||||
|
|
||||||
|
namespace grpc { |
||||||
|
namespace testing { |
||||||
|
|
||||||
|
void ParseJson(const grpc::string& json, const grpc::string& type, |
||||||
|
GRPC_CUSTOM_MESSAGE* msg); |
||||||
|
|
||||||
|
} // testing
|
||||||
|
} // grpc
|
||||||
|
|
||||||
|
#endif // TEST_QPS_PARSE_JSON_H
|
@ -1,167 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||||
<ItemGroup Label="ProjectConfigurations"> |
|
||||||
<ProjectConfiguration Include="Debug|Win32"> |
|
||||||
<Configuration>Debug</Configuration> |
|
||||||
<Platform>Win32</Platform> |
|
||||||
</ProjectConfiguration> |
|
||||||
<ProjectConfiguration Include="Debug|x64"> |
|
||||||
<Configuration>Debug</Configuration> |
|
||||||
<Platform>x64</Platform> |
|
||||||
</ProjectConfiguration> |
|
||||||
<ProjectConfiguration Include="Release|Win32"> |
|
||||||
<Configuration>Release</Configuration> |
|
||||||
<Platform>Win32</Platform> |
|
||||||
</ProjectConfiguration> |
|
||||||
<ProjectConfiguration Include="Release|x64"> |
|
||||||
<Configuration>Release</Configuration> |
|
||||||
<Platform>x64</Platform> |
|
||||||
</ProjectConfiguration> |
|
||||||
</ItemGroup> |
|
||||||
<PropertyGroup Label="Globals"> |
|
||||||
<ProjectGuid>{3589BCA3-CB0E-58FE-2F67-C4475D5CA517}</ProjectGuid> |
|
||||||
<IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> |
|
||||||
<IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> |
|
||||||
</PropertyGroup> |
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|
||||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> |
|
||||||
<PlatformToolset>v100</PlatformToolset> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration"> |
|
||||||
<PlatformToolset>v110</PlatformToolset> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration"> |
|
||||||
<PlatformToolset>v120</PlatformToolset> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration"> |
|
||||||
<PlatformToolset>v140</PlatformToolset> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> |
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|
||||||
<UseDebugLibraries>true</UseDebugLibraries> |
|
||||||
<CharacterSet>Unicode</CharacterSet> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> |
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|
||||||
<UseDebugLibraries>false</UseDebugLibraries> |
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|
||||||
<CharacterSet>Unicode</CharacterSet> |
|
||||||
</PropertyGroup> |
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|
||||||
<ImportGroup Label="ExtensionSettings"> |
|
||||||
</ImportGroup> |
|
||||||
<ImportGroup Label="PropertySheets"> |
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|
||||||
<Import Project="$(SolutionDir)\..\vsprojects\global.props" /> |
|
||||||
<Import Project="$(SolutionDir)\..\vsprojects\winsock.props" /> |
|
||||||
</ImportGroup> |
|
||||||
<PropertyGroup Label="UserMacros" /> |
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> |
|
||||||
<TargetName>one_input_fuzzer</TargetName> |
|
||||||
</PropertyGroup> |
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> |
|
||||||
<TargetName>one_input_fuzzer</TargetName> |
|
||||||
</PropertyGroup> |
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|
||||||
<ClCompile> |
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
|
||||||
<WarningLevel>Level3</WarningLevel> |
|
||||||
<Optimization>Disabled</Optimization> |
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|
||||||
<SDLCheck>true</SDLCheck> |
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|
||||||
<TreatWarningAsError>true</TreatWarningAsError> |
|
||||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
|
||||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
|
||||||
</ClCompile> |
|
||||||
<Link> |
|
||||||
<SubSystem>Windows</SubSystem> |
|
||||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
|
||||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
|
||||||
</Link> |
|
||||||
</ItemDefinitionGroup> |
|
||||||
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|
||||||
<ClCompile> |
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
|
||||||
<WarningLevel>Level3</WarningLevel> |
|
||||||
<Optimization>Disabled</Optimization> |
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|
||||||
<SDLCheck>true</SDLCheck> |
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|
||||||
<TreatWarningAsError>true</TreatWarningAsError> |
|
||||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
|
||||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
|
||||||
</ClCompile> |
|
||||||
<Link> |
|
||||||
<SubSystem>Windows</SubSystem> |
|
||||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
|
||||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
|
||||||
</Link> |
|
||||||
</ItemDefinitionGroup> |
|
||||||
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|
||||||
<ClCompile> |
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
|
||||||
<WarningLevel>Level3</WarningLevel> |
|
||||||
<Optimization>MaxSpeed</Optimization> |
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|
||||||
<SDLCheck>true</SDLCheck> |
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|
||||||
<TreatWarningAsError>true</TreatWarningAsError> |
|
||||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
|
||||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
|
||||||
</ClCompile> |
|
||||||
<Link> |
|
||||||
<SubSystem>Windows</SubSystem> |
|
||||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
|
||||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|
||||||
<OptimizeReferences>true</OptimizeReferences> |
|
||||||
</Link> |
|
||||||
</ItemDefinitionGroup> |
|
||||||
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|
||||||
<ClCompile> |
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
|
||||||
<WarningLevel>Level3</WarningLevel> |
|
||||||
<Optimization>MaxSpeed</Optimization> |
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|
||||||
<SDLCheck>true</SDLCheck> |
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|
||||||
<TreatWarningAsError>true</TreatWarningAsError> |
|
||||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
|
||||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
|
||||||
</ClCompile> |
|
||||||
<Link> |
|
||||||
<SubSystem>Windows</SubSystem> |
|
||||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
|
||||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|
||||||
<OptimizeReferences>true</OptimizeReferences> |
|
||||||
</Link> |
|
||||||
</ItemDefinitionGroup> |
|
||||||
|
|
||||||
<ItemGroup> |
|
||||||
<ClCompile Include="$(SolutionDir)\..\test\core\util\one_corpus_entry_fuzzer.c"> |
|
||||||
</ClCompile> |
|
||||||
</ItemGroup> |
|
||||||
<ItemGroup> |
|
||||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr\gpr.vcxproj"> |
|
||||||
<Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project> |
|
||||||
</ProjectReference> |
|
||||||
</ItemGroup> |
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|
||||||
<ImportGroup Label="ExtensionTargets"> |
|
||||||
</ImportGroup> |
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
|
||||||
<PropertyGroup> |
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> |
|
||||||
</PropertyGroup> |
|
||||||
</Target> |
|
||||||
</Project> |
|
||||||
|
|
@ -1,21 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||||
<ItemGroup> |
|
||||||
<ClCompile Include="$(SolutionDir)\..\test\core\util\one_corpus_entry_fuzzer.c"> |
|
||||||
<Filter>test\core\util</Filter> |
|
||||||
</ClCompile> |
|
||||||
</ItemGroup> |
|
||||||
|
|
||||||
<ItemGroup> |
|
||||||
<Filter Include="test"> |
|
||||||
<UniqueIdentifier>{178c17dc-766b-aa84-e928-d6bd0e456ff9}</UniqueIdentifier> |
|
||||||
</Filter> |
|
||||||
<Filter Include="test\core"> |
|
||||||
<UniqueIdentifier>{f08c2f86-ff65-4ce8-1ae6-e40fae0cef67}</UniqueIdentifier> |
|
||||||
</Filter> |
|
||||||
<Filter Include="test\core\util"> |
|
||||||
<UniqueIdentifier>{17c672ec-2cce-5636-14c8-4812cd2e1b9a}</UniqueIdentifier> |
|
||||||
</Filter> |
|
||||||
</ItemGroup> |
|
||||||
</Project> |
|
||||||
|
|
Loading…
Reference in new issue