Index: .gitignore
===================================================================
diff -u -N -r4572f6cddf7dab06b1de99504a6bbd3680d11e6d -r4a481bbe77043e0bda2435c6d62a02700b3e46c5
--- .gitignore (.../.gitignore) (revision 4572f6cddf7dab06b1de99504a6bbd3680d11e6d)
+++ .gitignore (.../.gitignore) (revision 4a481bbe77043e0bda2435c6d62a02700b3e46c5)
@@ -7,6 +7,7 @@
*.user
*.opendb
*.aps
+*.db
src/ch/help/HTMLDefines.h
src/ch/help/*/HTMLDefines.h
src/ch/help/*/*.chm
@@ -16,4 +17,3 @@
src/chext/chext_p.c
src/chext/dlldata.c
_ReSharper.Caches
-ch.vc140.VC.db
Index: ch.vc140.sln
===================================================================
diff -u -N -ra27d1acf1bda3c25b6dcce0d0eb0278009ce63ae -r4a481bbe77043e0bda2435c6d62a02700b3e46c5
--- ch.vc140.sln (.../ch.vc140.sln) (revision a27d1acf1bda3c25b6dcce0d0eb0278009ce63ae)
+++ ch.vc140.sln (.../ch.vc140.sln) (revision 4a481bbe77043e0bda2435c6d62a02700b3e46c5)
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
-VisualStudioVersion = 14.0.24720.0
+VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ch", "src\ch\ch.vc140.vcxproj", "{4B215B9A-58CA-4987-AC95-7DFC3043E100}"
ProjectSection(ProjectDependencies) = postProject
@@ -28,10 +28,10 @@
{D98F2D98-2352-4303-93EE-A5430C4E98AB} = {D98F2D98-2352-4303-93EE-A5430C4E98AB}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "ext\gmock\gmock.vc140.vcxproj", "{D98F2D98-2352-4303-93EE-A5430C4E98AB}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "ext\sqlite3\sqlite3.vc140.vcxproj", "{D41831F5-B2A5-4C92-9F15-1D9AB04722CC}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "ext\googletest\gmock.vc140.vcxproj", "{D98F2D98-2352-4303-93EE-A5430C4E98AB}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -124,18 +124,6 @@
{CBBF380B-7B16-4A1E-8194-758DAD7D8011}.Testing Release|Win32.Build.0 = Testing Release|Win32
{CBBF380B-7B16-4A1E-8194-758DAD7D8011}.Testing Release|x64.ActiveCfg = Testing Release|x64
{CBBF380B-7B16-4A1E-8194-758DAD7D8011}.Testing Release|x64.Build.0 = Testing Release|x64
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Debug|Win32.ActiveCfg = Debug|Win32
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Debug|x64.ActiveCfg = Debug|x64
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Release|Win32.ActiveCfg = Release|Win32
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Release|x64.ActiveCfg = Release|x64
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Debug|Win32.ActiveCfg = Testing Debug|Win32
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Debug|Win32.Build.0 = Testing Debug|Win32
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Debug|x64.ActiveCfg = Testing Debug|x64
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Debug|x64.Build.0 = Testing Debug|x64
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Release|Win32.ActiveCfg = Testing Release|Win32
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Release|Win32.Build.0 = Testing Release|Win32
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Release|x64.ActiveCfg = Testing Release|x64
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Release|x64.Build.0 = Testing Release|x64
{D41831F5-B2A5-4C92-9F15-1D9AB04722CC}.Debug|Win32.ActiveCfg = Debug|Win32
{D41831F5-B2A5-4C92-9F15-1D9AB04722CC}.Debug|Win32.Build.0 = Debug|Win32
{D41831F5-B2A5-4C92-9F15-1D9AB04722CC}.Debug|x64.ActiveCfg = Debug|x64
@@ -152,6 +140,22 @@
{D41831F5-B2A5-4C92-9F15-1D9AB04722CC}.Testing Release|Win32.Build.0 = Testing Release|Win32
{D41831F5-B2A5-4C92-9F15-1D9AB04722CC}.Testing Release|x64.ActiveCfg = Testing Release|x64
{D41831F5-B2A5-4C92-9F15-1D9AB04722CC}.Testing Release|x64.Build.0 = Testing Release|x64
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Debug|Win32.Build.0 = Debug|Win32
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Debug|x64.ActiveCfg = Debug|x64
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Debug|x64.Build.0 = Debug|x64
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Release|Win32.ActiveCfg = Release|Win32
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Release|Win32.Build.0 = Release|Win32
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Release|x64.ActiveCfg = Release|x64
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Release|x64.Build.0 = Release|x64
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Debug|Win32.ActiveCfg = Testing Debug|Win32
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Debug|Win32.Build.0 = Testing Debug|Win32
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Debug|x64.ActiveCfg = Testing Debug|x64
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Debug|x64.Build.0 = Testing Debug|x64
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Release|Win32.ActiveCfg = Testing Release|Win32
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Release|Win32.Build.0 = Testing Release|Win32
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Release|x64.ActiveCfg = Testing Release|x64
+ {D98F2D98-2352-4303-93EE-A5430C4E98AB}.Testing Release|x64.Build.0 = Testing Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Index: ext/gmock/Readme.txt
===================================================================
diff -u -N
--- ext/gmock/Readme.txt (revision b30d278c31a7c78e59bf3427347a168a3475d405)
+++ ext/gmock/Readme.txt (revision 0)
@@ -1,2 +0,0 @@
-gtest/gmock framework version 1.7.0.
-See http://code.google.com/p/googlemock/
\ No newline at end of file
Index: ext/gmock/gmock.vcproj
===================================================================
diff -u -N
--- ext/gmock/gmock.vcproj (revision 2e23b5892ef4d4bb1ee2c6cde893004a71a11510)
+++ ext/gmock/gmock.vcproj (revision 0)
@@ -1,559 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: ext/gmock/gmock.vcxproj
===================================================================
diff -u -N
--- ext/gmock/gmock.vcxproj (revision 6103ac74583f2136b821dc67515ed8469abd8155)
+++ ext/gmock/gmock.vcxproj (revision 0)
@@ -1,326 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
- Testing Debug
- Win32
-
-
- Testing Debug
- x64
-
-
- Testing Release
- Win32
-
-
- Testing Release
- x64
-
-
-
- {D98F2D98-2352-4303-93EE-A5430C4E98AB}
- gmock
- Win32Proj
-
-
-
- StaticLibrary
- v120_xp
- Unicode
- true
-
-
- StaticLibrary
- v120_xp
- Unicode
- true
-
-
- StaticLibrary
- v120_xp
- Unicode
-
-
- StaticLibrary
- v120_xp
- Unicode
-
-
- StaticLibrary
- v120_xp
- Unicode
- true
-
-
- StaticLibrary
- v120_xp
- Unicode
- true
-
-
- StaticLibrary
- v120_xp
- Unicode
-
-
- StaticLibrary
- v120_xp
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>11.0.51106.1
-
-
- $(SolutionDir)bin\$(Configuration)\
- $(SolutionDir)intermediate\vc120\$(Platform)\$(ProjectName)_$(Configuration)\
- $(ProjectName)32d
- C:\dev\boost_1_58_0;$(IncludePath)
- C:\dev\boost_1_58_0\lib-12.0\x32\lib;$(LibraryPath)
-
-
- $(SolutionDir)bin\$(Configuration)\
- $(SolutionDir)intermediate\vc120\$(Platform)\$(ProjectName)_$(Configuration)\
- $(ProjectName)32d
- C:\dev\boost_1_58_0;$(IncludePath)
- C:\dev\boost_1_58_0\lib-12.0\x32\lib;$(LibraryPath)
-
-
- $(SolutionDir)bin\$(Configuration)\
- $(SolutionDir)intermediate\vc120\$(Platform)\$(ProjectName)_$(Configuration)\
- AllRules.ruleset
- false
- $(ProjectName)64d
- C:\dev\boost_1_58_0;$(IncludePath)
- C:\dev\boost_1_58_0\lib-12.0\x64\lib;$(LibraryPath)
-
-
- $(SolutionDir)bin\$(Configuration)\
- $(SolutionDir)intermediate\vc120\$(Platform)\$(ProjectName)_$(Configuration)\
- AllRules.ruleset
- false
- $(ProjectName)64d
- C:\dev\boost_1_58_0;$(IncludePath)
- C:\dev\boost_1_58_0\lib-12.0\x64\lib;$(LibraryPath)
-
-
- $(SolutionDir)bin\$(Configuration)\
- $(SolutionDir)intermediate\vc120\$(Platform)\$(ProjectName)_$(Configuration)\
- $(ProjectName)32
- C:\dev\boost_1_58_0;$(IncludePath)
- C:\dev\boost_1_58_0\lib-12.0\x32\lib;$(LibraryPath)
-
-
- $(SolutionDir)bin\$(Configuration)\
- $(SolutionDir)intermediate\vc120\$(Platform)\$(ProjectName)_$(Configuration)\
- $(ProjectName)32
- C:\dev\boost_1_58_0;$(IncludePath)
- C:\dev\boost_1_58_0\lib-12.0\x32\lib;$(LibraryPath)
-
-
- $(SolutionDir)bin\$(Configuration)\
- $(SolutionDir)intermediate\vc120\$(Platform)\$(ProjectName)_$(Configuration)\
- $(ProjectName)64
- C:\dev\boost_1_58_0;$(IncludePath)
- C:\dev\boost_1_58_0\lib-12.0\x64\lib;$(LibraryPath)
-
-
- $(SolutionDir)bin\$(Configuration)\
- $(SolutionDir)intermediate\vc120\$(Platform)\$(ProjectName)_$(Configuration)\
- $(ProjectName)64
- C:\dev\boost_1_58_0;$(IncludePath)
- C:\dev\boost_1_58_0\lib-12.0\x64\lib;$(LibraryPath)
-
-
-
- Disabled
- include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebugDLL
-
- Level3
- EditAndContinue
- true
-
-
-
-
-
- Disabled
- include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebugDLL
-
-
- Level3
- EditAndContinue
- true
-
-
-
-
-
- X64
-
-
- Disabled
- include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebugDLL
-
- Level3
- ProgramDatabase
- false
- true
-
-
-
-
-
- X64
-
-
- Disabled
- include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebugDLL
-
-
- Level3
- ProgramDatabase
- false
- true
-
-
-
-
-
- MaxSpeed
- true
- include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_LIB;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)
- MultiThreadedDLL
- true
-
- Level3
- ProgramDatabase
- true
-
-
-
-
-
- MaxSpeed
- true
- include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_LIB;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)
- MultiThreadedDLL
- true
-
-
- Level3
- ProgramDatabase
- true
-
-
-
-
-
- X64
-
-
- MaxSpeed
- true
- include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_LIB;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)
- MultiThreadedDLL
- true
-
- Level3
- ProgramDatabase
- true
-
-
-
-
-
- X64
-
-
- MaxSpeed
- true
- include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_LIB;_BIND_TO_CURRENT_VCLIBS_VERSION=1;_VARIADIC_MAX=10;%(PreprocessorDefinitions)
- MultiThreadedDLL
- true
-
-
- Level3
- ProgramDatabase
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: ext/gmock/gmock.vcxproj.filters
===================================================================
diff -u -N
--- ext/gmock/gmock.vcxproj.filters (revision dd61ac70dd276425fe97970b49b6854d02bfcc87)
+++ ext/gmock/gmock.vcxproj.filters (revision 0)
@@ -1,22 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
-
-
- Source Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
Index: ext/gmock/include/gmock/gmock.h
===================================================================
diff -u -N
--- ext/gmock/include/gmock/gmock.h (revision b30d278c31a7c78e59bf3427347a168a3475d405)
+++ ext/gmock/include/gmock/gmock.h (revision 0)
@@ -1,14198 +0,0 @@
-// Copyright 2007, 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This is the main header file a user should include.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_H_
-
-// This file implements the following syntax:
-//
-// ON_CALL(mock_object.Method(...))
-// .With(...) ?
-// .WillByDefault(...);
-//
-// where With() is optional and WillByDefault() must appear exactly
-// once.
-//
-// EXPECT_CALL(mock_object.Method(...))
-// .With(...) ?
-// .Times(...) ?
-// .InSequence(...) *
-// .WillOnce(...) *
-// .WillRepeatedly(...) ?
-// .RetiresOnSaturation() ? ;
-//
-// where all clauses are optional and WillOnce() can be repeated.
-
-// Copyright 2007, 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used actions.
-
-#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
-#define GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
-
-#ifndef _WIN32_WCE
-# include
-#endif
-
-#include
-#include
-
-// Copyright 2007, 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file defines some utilities useful for implementing Google
-// Mock. They are subject to change without notice, so please DO NOT
-// USE THEM IN USER CODE.
-
-#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
-#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
-
-#include
-#include // NOLINT
-#include
-
-// This file was GENERATED by command:
-// pump.py gmock-generated-internal-utils.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2007, 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file contains template meta-programming utility classes needed
-// for implementing Google Mock.
-
-#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
-#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
-
-// Copyright 2008, 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.
-//
-// Author: vadimb@google.com (Vadim Berman)
-//
-// Low-level types and utilities for porting Google Mock to various
-// platforms. They are subject to change without notice. DO NOT USE
-// THEM IN USER CODE.
-
-#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
-#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
-
-#include
-#include
-#include
-
-// Most of the types needed for porting Google Mock are also required
-// for Google Test and are defined in gtest-port.h.
-#include "gtest/gtest.h"
-
-// To avoid conditional compilation everywhere, we make it
-// gmock-port.h's responsibility to #include the header implementing
-// tr1/tuple. gmock-port.h does this via gtest-port.h, which is
-// guaranteed to pull in the tuple header.
-
-// For MS Visual C++, check the compiler version. At least VS 2003 is
-// required to compile Google Mock.
-#if defined(_MSC_VER) && _MSC_VER < 1310
-# error "At least Visual C++ 2003 (7.1) is required to compile Google Mock."
-#endif
-
-// Macro for referencing flags. This is public as we want the user to
-// use this syntax to reference Google Mock flags.
-#define GMOCK_FLAG(name) FLAGS_gmock_##name
-
-// Macros for declaring flags.
-#define GMOCK_DECLARE_bool_(name) extern GTEST_API_ bool GMOCK_FLAG(name)
-#define GMOCK_DECLARE_int32_(name) \
- extern GTEST_API_ ::testing::internal::Int32 GMOCK_FLAG(name)
-#define GMOCK_DECLARE_string_(name) \
- extern GTEST_API_ ::std::string GMOCK_FLAG(name)
-
-// Macros for defining flags.
-#define GMOCK_DEFINE_bool_(name, default_val, doc) \
- GTEST_API_ bool GMOCK_FLAG(name) = (default_val)
-#define GMOCK_DEFINE_int32_(name, default_val, doc) \
- GTEST_API_ ::testing::internal::Int32 GMOCK_FLAG(name) = (default_val)
-#define GMOCK_DEFINE_string_(name, default_val, doc) \
- GTEST_API_ ::std::string GMOCK_FLAG(name) = (default_val)
-
-#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
-
-namespace testing {
-
-template
-class Matcher;
-
-namespace internal {
-
-// An IgnoredValue object can be implicitly constructed from ANY value.
-// This is used in implementing the IgnoreResult(a) action.
-class IgnoredValue {
- public:
- // This constructor template allows any value to be implicitly
- // converted to IgnoredValue. The object has no data member and
- // doesn't try to remember anything about the argument. We
- // deliberately omit the 'explicit' keyword in order to allow the
- // conversion to be implicit.
- template
- IgnoredValue(const T& /* ignored */) {} // NOLINT(runtime/explicit)
-};
-
-// MatcherTuple::type is a tuple type where each field is a Matcher
-// for the corresponding field in tuple type T.
-template
-struct MatcherTuple;
-
-template <>
-struct MatcherTuple< ::std::tr1::tuple<> > {
- typedef ::std::tr1::tuple< > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher, Matcher > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher, Matcher,
- Matcher > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher, Matcher, Matcher,
- Matcher > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher, Matcher, Matcher,
- Matcher, Matcher > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher, Matcher, Matcher,
- Matcher, Matcher, Matcher > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher, Matcher, Matcher,
- Matcher, Matcher, Matcher, Matcher > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher, Matcher, Matcher,
- Matcher, Matcher, Matcher, Matcher, Matcher > type;
-};
-
-template
-struct MatcherTuple< ::std::tr1::tuple > {
- typedef ::std::tr1::tuple, Matcher, Matcher, Matcher,
- Matcher, Matcher, Matcher, Matcher, Matcher,
- Matcher > type;
-};
-
-// Template struct Function, where F must be a function type, contains
-// the following typedefs:
-//
-// Result: the function's return type.
-// ArgumentN: the type of the N-th argument, where N starts with 1.
-// ArgumentTuple: the tuple type consisting of all parameters of F.
-// ArgumentMatcherTuple: the tuple type consisting of Matchers for all
-// parameters of F.
-// MakeResultVoid: the function type obtained by substituting void
-// for the return type of F.
-// MakeResultIgnoredValue:
-// the function type obtained by substituting Something
-// for the return type of F.
-template
-struct Function;
-
-template
-struct Function {
- typedef R Result;
- typedef ::std::tr1::tuple<> ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid();
- typedef IgnoredValue MakeResultIgnoredValue();
-};
-
-template
-struct Function
- : Function {
- typedef A1 Argument1;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1);
- typedef IgnoredValue MakeResultIgnoredValue(A1);
-};
-
-template
-struct Function
- : Function {
- typedef A2 Argument2;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
-};
-
-template
-struct Function
- : Function {
- typedef A3 Argument3;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
-};
-
-template
-struct Function
- : Function {
- typedef A4 Argument4;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
-};
-
-template
-struct Function
- : Function {
- typedef A5 Argument5;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
-};
-
-template
-struct Function
- : Function {
- typedef A6 Argument6;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
-};
-
-template
-struct Function
- : Function {
- typedef A7 Argument7;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
-};
-
-template
-struct Function
- : Function {
- typedef A8 Argument8;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8);
-};
-
-template
-struct Function
- : Function {
- typedef A9 Argument9;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
- A9);
-};
-
-template
-struct Function
- : Function {
- typedef A10 Argument10;
- typedef ::std::tr1::tuple ArgumentTuple;
- typedef typename MatcherTuple::type ArgumentMatcherTuple;
- typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
- typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
- A9, A10);
-};
-
-} // namespace internal
-
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
-
-namespace testing {
-namespace internal {
-
-// Converts an identifier name to a space-separated list of lower-case
-// words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
-// treated as one word. For example, both "FooBar123" and
-// "foo_bar_123" are converted to "foo bar 123".
-GTEST_API_ string ConvertIdentifierNameToWords(const char* id_name);
-
-// PointeeOf::type is the type of a value pointed to by a
-// Pointer, which can be either a smart pointer or a raw pointer. The
-// following default implementation is for the case where Pointer is a
-// smart pointer.
-template
-struct PointeeOf {
- // Smart pointer classes define type element_type as the type of
- // their pointees.
- typedef typename Pointer::element_type type;
-};
-// This specialization is for the raw pointer case.
-template
-struct PointeeOf { typedef T type; }; // NOLINT
-
-// GetRawPointer(p) returns the raw pointer underlying p when p is a
-// smart pointer, or returns p itself when p is already a raw pointer.
-// The following default implementation is for the smart pointer case.
-template
-inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {
- return p.get();
-}
-// This overloaded version is for the raw pointer case.
-template
-inline Element* GetRawPointer(Element* p) { return p; }
-
-// This comparator allows linked_ptr to be stored in sets.
-template
-struct LinkedPtrLessThan {
- bool operator()(const ::testing::internal::linked_ptr& lhs,
- const ::testing::internal::linked_ptr& rhs) const {
- return lhs.get() < rhs.get();
- }
-};
-
-// Symbian compilation can be done with wchar_t being either a native
-// type or a typedef. Using Google Mock with OpenC without wchar_t
-// should require the definition of _STLP_NO_WCHAR_T.
-//
-// MSVC treats wchar_t as a native type usually, but treats it as the
-// same as unsigned short when the compiler option /Zc:wchar_t- is
-// specified. It defines _NATIVE_WCHAR_T_DEFINED symbol when wchar_t
-// is a native type.
-#if (GTEST_OS_SYMBIAN && defined(_STLP_NO_WCHAR_T)) || \
- (defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED))
-// wchar_t is a typedef.
-#else
-# define GMOCK_WCHAR_T_IS_NATIVE_ 1
-#endif
-
-// signed wchar_t and unsigned wchar_t are NOT in the C++ standard.
-// Using them is a bad practice and not portable. So DON'T use them.
-//
-// Still, Google Mock is designed to work even if the user uses signed
-// wchar_t or unsigned wchar_t (obviously, assuming the compiler
-// supports them).
-//
-// To gcc,
-// wchar_t == signed wchar_t != unsigned wchar_t == unsigned int
-#ifdef __GNUC__
-// signed/unsigned wchar_t are valid types.
-# define GMOCK_HAS_SIGNED_WCHAR_T_ 1
-#endif
-
-// In what follows, we use the term "kind" to indicate whether a type
-// is bool, an integer type (excluding bool), a floating-point type,
-// or none of them. This categorization is useful for determining
-// when a matcher argument type can be safely converted to another
-// type in the implementation of SafeMatcherCast.
-enum TypeKind {
- kBool, kInteger, kFloatingPoint, kOther
-};
-
-// KindOf::value is the kind of type T.
-template struct KindOf {
- enum { value = kOther }; // The default kind.
-};
-
-// This macro declares that the kind of 'type' is 'kind'.
-#define GMOCK_DECLARE_KIND_(type, kind) \
- template <> struct KindOf { enum { value = kind }; }
-
-GMOCK_DECLARE_KIND_(bool, kBool);
-
-// All standard integer types.
-GMOCK_DECLARE_KIND_(char, kInteger);
-GMOCK_DECLARE_KIND_(signed char, kInteger);
-GMOCK_DECLARE_KIND_(unsigned char, kInteger);
-GMOCK_DECLARE_KIND_(short, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(unsigned short, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(int, kInteger);
-GMOCK_DECLARE_KIND_(unsigned int, kInteger);
-GMOCK_DECLARE_KIND_(long, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(unsigned long, kInteger); // NOLINT
-
-#if GMOCK_WCHAR_T_IS_NATIVE_
-GMOCK_DECLARE_KIND_(wchar_t, kInteger);
-#endif
-
-// Non-standard integer types.
-GMOCK_DECLARE_KIND_(Int64, kInteger);
-GMOCK_DECLARE_KIND_(UInt64, kInteger);
-
-// All standard floating-point types.
-GMOCK_DECLARE_KIND_(float, kFloatingPoint);
-GMOCK_DECLARE_KIND_(double, kFloatingPoint);
-GMOCK_DECLARE_KIND_(long double, kFloatingPoint);
-
-#undef GMOCK_DECLARE_KIND_
-
-// Evaluates to the kind of 'type'.
-#define GMOCK_KIND_OF_(type) \
- static_cast< ::testing::internal::TypeKind>( \
- ::testing::internal::KindOf::value)
-
-// Evaluates to true iff integer type T is signed.
-#define GMOCK_IS_SIGNED_(T) (static_cast(-1) < 0)
-
-// LosslessArithmeticConvertibleImpl::value
-// is true iff arithmetic type From can be losslessly converted to
-// arithmetic type To.
-//
-// It's the user's responsibility to ensure that both From and To are
-// raw (i.e. has no CV modifier, is not a pointer, and is not a
-// reference) built-in arithmetic types, kFromKind is the kind of
-// From, and kToKind is the kind of To; the value is
-// implementation-defined when the above pre-condition is violated.
-template
-struct LosslessArithmeticConvertibleImpl : public false_type {};
-
-// Converting bool to bool is lossless.
-template <>
-struct LosslessArithmeticConvertibleImpl
- : public true_type {}; // NOLINT
-
-// Converting bool to any integer type is lossless.
-template
-struct LosslessArithmeticConvertibleImpl
- : public true_type {}; // NOLINT
-
-// Converting bool to any floating-point type is lossless.
-template
-struct LosslessArithmeticConvertibleImpl
- : public true_type {}; // NOLINT
-
-// Converting an integer to bool is lossy.
-template
-struct LosslessArithmeticConvertibleImpl
- : public false_type {}; // NOLINT
-
-// Converting an integer to another non-bool integer is lossless iff
-// the target type's range encloses the source type's range.
-template
-struct LosslessArithmeticConvertibleImpl
- : public bool_constant<
- // When converting from a smaller size to a larger size, we are
- // fine as long as we are not converting from signed to unsigned.
- ((sizeof(From) < sizeof(To)) &&
- (!GMOCK_IS_SIGNED_(From) || GMOCK_IS_SIGNED_(To))) ||
- // When converting between the same size, the signedness must match.
- ((sizeof(From) == sizeof(To)) &&
- (GMOCK_IS_SIGNED_(From) == GMOCK_IS_SIGNED_(To)))> {}; // NOLINT
-
-#undef GMOCK_IS_SIGNED_
-
-// Converting an integer to a floating-point type may be lossy, since
-// the format of a floating-point number is implementation-defined.
-template
-struct LosslessArithmeticConvertibleImpl
- : public false_type {}; // NOLINT
-
-// Converting a floating-point to bool is lossy.
-template
-struct LosslessArithmeticConvertibleImpl
- : public false_type {}; // NOLINT
-
-// Converting a floating-point to an integer is lossy.
-template
-struct LosslessArithmeticConvertibleImpl
- : public false_type {}; // NOLINT
-
-// Converting a floating-point to another floating-point is lossless
-// iff the target type is at least as big as the source type.
-template
-struct LosslessArithmeticConvertibleImpl<
- kFloatingPoint, From, kFloatingPoint, To>
- : public bool_constant {}; // NOLINT
-
-// LosslessArithmeticConvertible::value is true iff arithmetic
-// type From can be losslessly converted to arithmetic type To.
-//
-// It's the user's responsibility to ensure that both From and To are
-// raw (i.e. has no CV modifier, is not a pointer, and is not a
-// reference) built-in arithmetic types; the value is
-// implementation-defined when the above pre-condition is violated.
-template
-struct LosslessArithmeticConvertible
- : public LosslessArithmeticConvertibleImpl<
- GMOCK_KIND_OF_(From), From, GMOCK_KIND_OF_(To), To> {}; // NOLINT
-
-// This interface knows how to report a Google Mock failure (either
-// non-fatal or fatal).
-class FailureReporterInterface {
- public:
- // The type of a failure (either non-fatal or fatal).
- enum FailureType {
- kNonfatal, kFatal
- };
-
- virtual ~FailureReporterInterface() {}
-
- // Reports a failure that occurred at the given source file location.
- virtual void ReportFailure(FailureType type, const char* file, int line,
- const string& message) = 0;
-};
-
-// Returns the failure reporter used by Google Mock.
-GTEST_API_ FailureReporterInterface* GetFailureReporter();
-
-// Asserts that condition is true; aborts the process with the given
-// message if condition is false. We cannot use LOG(FATAL) or CHECK()
-// as Google Mock might be used to mock the log sink itself. We
-// inline this function to prevent it from showing up in the stack
-// trace.
-inline void Assert(bool condition, const char* file, int line,
- const string& msg) {
- if (!condition) {
- GetFailureReporter()->ReportFailure(FailureReporterInterface::kFatal,
- file, line, msg);
- }
-}
-inline void Assert(bool condition, const char* file, int line) {
- Assert(condition, file, line, "Assertion failed.");
-}
-
-// Verifies that condition is true; generates a non-fatal failure if
-// condition is false.
-inline void Expect(bool condition, const char* file, int line,
- const string& msg) {
- if (!condition) {
- GetFailureReporter()->ReportFailure(FailureReporterInterface::kNonfatal,
- file, line, msg);
- }
-}
-inline void Expect(bool condition, const char* file, int line) {
- Expect(condition, file, line, "Expectation failed.");
-}
-
-// Severity level of a log.
-enum LogSeverity {
- kInfo = 0,
- kWarning = 1
-};
-
-// Valid values for the --gmock_verbose flag.
-
-// All logs (informational and warnings) are printed.
-const char kInfoVerbosity[] = "info";
-// Only warnings are printed.
-const char kWarningVerbosity[] = "warning";
-// No logs are printed.
-const char kErrorVerbosity[] = "error";
-
-// Returns true iff a log with the given severity is visible according
-// to the --gmock_verbose flag.
-GTEST_API_ bool LogIsVisible(LogSeverity severity);
-
-// Prints the given message to stdout iff 'severity' >= the level
-// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
-// 0, also prints the stack trace excluding the top
-// stack_frames_to_skip frames. In opt mode, any positive
-// stack_frames_to_skip is treated as 0, since we don't know which
-// function calls will be inlined by the compiler and need to be
-// conservative.
-GTEST_API_ void Log(LogSeverity severity,
- const string& message,
- int stack_frames_to_skip);
-
-// TODO(wan@google.com): group all type utilities together.
-
-// Type traits.
-
-// is_reference::value is non-zero iff T is a reference type.
-template struct is_reference : public false_type {};
-template struct is_reference : public true_type {};
-
-// type_equals::value is non-zero iff T1 and T2 are the same type.
-template struct type_equals : public false_type {};
-template struct type_equals : public true_type {};
-
-// remove_reference::type removes the reference from type T, if any.
-template struct remove_reference { typedef T type; }; // NOLINT
-template struct remove_reference { typedef T type; }; // NOLINT
-
-// DecayArray::type turns an array type U[N] to const U* and preserves
-// other types. Useful for saving a copy of a function argument.
-template struct DecayArray { typedef T type; }; // NOLINT
-template struct DecayArray {
- typedef const T* type;
-};
-// Sometimes people use arrays whose size is not available at the use site
-// (e.g. extern const char kNamePrefix[]). This specialization covers that
-// case.
-template struct DecayArray {
- typedef const T* type;
-};
-
-// Invalid() returns an invalid value of type T. This is useful
-// when a value of type T is needed for compilation, but the statement
-// will not really be executed (or we don't care if the statement
-// crashes).
-template
-inline T Invalid() {
- return const_cast::type&>(
- *static_cast::type*>(NULL));
-}
-template <>
-inline void Invalid() {}
-
-// Given a raw type (i.e. having no top-level reference or const
-// modifier) RawContainer that's either an STL-style container or a
-// native array, class StlContainerView has the
-// following members:
-//
-// - type is a type that provides an STL-style container view to
-// (i.e. implements the STL container concept for) RawContainer;
-// - const_reference is a type that provides a reference to a const
-// RawContainer;
-// - ConstReference(raw_container) returns a const reference to an STL-style
-// container view to raw_container, which is a RawContainer.
-// - Copy(raw_container) returns an STL-style container view of a
-// copy of raw_container, which is a RawContainer.
-//
-// This generic version is used when RawContainer itself is already an
-// STL-style container.
-template
-class StlContainerView {
- public:
- typedef RawContainer type;
- typedef const type& const_reference;
-
- static const_reference ConstReference(const RawContainer& container) {
- // Ensures that RawContainer is not a const type.
- testing::StaticAssertTypeEq();
- return container;
- }
- static type Copy(const RawContainer& container) { return container; }
-};
-
-// This specialization is used when RawContainer is a native array type.
-template
-class StlContainerView {
- public:
- typedef GTEST_REMOVE_CONST_(Element) RawElement;
- typedef internal::NativeArray type;
- // NativeArray can represent a native array either by value or by
- // reference (selected by a constructor argument), so 'const type'
- // can be used to reference a const native array. We cannot
- // 'typedef const type& const_reference' here, as that would mean
- // ConstReference() has to return a reference to a local variable.
- typedef const type const_reference;
-
- static const_reference ConstReference(const Element (&array)[N]) {
- // Ensures that Element is not a const type.
- testing::StaticAssertTypeEq();
-#if GTEST_OS_SYMBIAN
- // The Nokia Symbian compiler confuses itself in template instantiation
- // for this call without the cast to Element*:
- // function call '[testing::internal::NativeArray].NativeArray(
- // {lval} const char *[4], long, testing::internal::RelationToSource)'
- // does not match
- // 'testing::internal::NativeArray::NativeArray(
- // char *const *, unsigned int, testing::internal::RelationToSource)'
- // (instantiating: 'testing::internal::ContainsMatcherImpl
- // ::Matches(const char * (&)[4]) const')
- // (instantiating: 'testing::internal::StlContainerView::
- // ConstReference(const char * (&)[4])')
- // (and though the N parameter type is mismatched in the above explicit
- // conversion of it doesn't help - only the conversion of the array).
- return type(const_cast(&array[0]), N, kReference);
-#else
- return type(array, N, kReference);
-#endif // GTEST_OS_SYMBIAN
- }
- static type Copy(const Element (&array)[N]) {
-#if GTEST_OS_SYMBIAN
- return type(const_cast(&array[0]), N, kCopy);
-#else
- return type(array, N, kCopy);
-#endif // GTEST_OS_SYMBIAN
- }
-};
-
-// This specialization is used when RawContainer is a native array
-// represented as a (pointer, size) tuple.
-template
-class StlContainerView< ::std::tr1::tuple > {
- public:
- typedef GTEST_REMOVE_CONST_(
- typename internal::PointeeOf::type) RawElement;
- typedef internal::NativeArray type;
- typedef const type const_reference;
-
- static const_reference ConstReference(
- const ::std::tr1::tuple& array) {
- using ::std::tr1::get;
- return type(get<0>(array), get<1>(array), kReference);
- }
- static type Copy(const ::std::tr1::tuple& array) {
- using ::std::tr1::get;
- return type(get<0>(array), get<1>(array), kCopy);
- }
-};
-
-// The following specialization prevents the user from instantiating
-// StlContainer with a reference type.
-template class StlContainerView;
-
-// A type transform to remove constness from the first part of a pair.
-// Pairs like that are used as the value_type of associative containers,
-// and this transform produces a similar but assignable pair.
-template
-struct RemoveConstFromKey {
- typedef T type;
-};
-
-// Partially specialized to remove constness from std::pair.
-template
-struct RemoveConstFromKey > {
- typedef std::pair type;
-};
-
-// Mapping from booleans to types. Similar to boost::bool_ and
-// std::integral_constant.
-template
-struct BooleanConstant {};
-
-} // namespace internal
-} // namespace testing
-
-#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
-
-namespace testing {
-
-// To implement an action Foo, define:
-// 1. a class FooAction that implements the ActionInterface interface, and
-// 2. a factory function that creates an Action object from a
-// const FooAction*.
-//
-// The two-level delegation design follows that of Matcher, providing
-// consistency for extension developers. It also eases ownership
-// management as Action objects can now be copied like plain values.
-
-namespace internal {
-
-template
-class ActionAdaptor;
-
-// BuiltInDefaultValue::Get() returns the "built-in" default
-// value for type T, which is NULL when T is a pointer type, 0 when T
-// is a numeric type, false when T is bool, or "" when T is string or
-// std::string. For any other type T, this value is undefined and the
-// function will abort the process.
-template
-class BuiltInDefaultValue {
- public:
- // This function returns true iff type T has a built-in default value.
- static bool Exists() { return false; }
- static T Get() {
- Assert(false, __FILE__, __LINE__,
- "Default action undefined for the function return type.");
- return internal::Invalid();
- // The above statement will never be reached, but is required in
- // order for this function to compile.
- }
-};
-
-// This partial specialization says that we use the same built-in
-// default value for T and const T.
-template
-class BuiltInDefaultValue {
- public:
- static bool Exists() { return BuiltInDefaultValue::Exists(); }
- static T Get() { return BuiltInDefaultValue::Get(); }
-};
-
-// This partial specialization defines the default values for pointer
-// types.
-template
-class BuiltInDefaultValue {
- public:
- static bool Exists() { return true; }
- static T* Get() { return NULL; }
-};
-
-// The following specializations define the default values for
-// specific types we care about.
-#define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \
- template <> \
- class BuiltInDefaultValue { \
- public: \
- static bool Exists() { return true; } \
- static type Get() { return value; } \
- }
-
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT
-#if GTEST_HAS_GLOBAL_STRING
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::string, "");
-#endif // GTEST_HAS_GLOBAL_STRING
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, "");
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0');
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0');
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0');
-
-// There's no need for a default action for signed wchar_t, as that
-// type is the same as wchar_t for gcc, and invalid for MSVC.
-//
-// There's also no need for a default action for unsigned wchar_t, as
-// that type is the same as unsigned int for gcc, and invalid for
-// MSVC.
-#if GMOCK_WCHAR_T_IS_NATIVE_
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT
-#endif
-
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(UInt64, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(Int64, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0);
-
-#undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_
-
-} // namespace internal
-
-// When an unexpected function call is encountered, Google Mock will
-// let it return a default value if the user has specified one for its
-// return type, or if the return type has a built-in default value;
-// otherwise Google Mock won't know what value to return and will have
-// to abort the process.
-//
-// The DefaultValue class allows a user to specify the
-// default value for a type T that is both copyable and publicly
-// destructible (i.e. anything that can be used as a function return
-// type). The usage is:
-//
-// // Sets the default value for type T to be foo.
-// DefaultValue::Set(foo);
-template
-class DefaultValue {
- public:
- // Sets the default value for type T; requires T to be
- // copy-constructable and have a public destructor.
- static void Set(T x) {
- delete value_;
- value_ = new T(x);
- }
-
- // Unsets the default value for type T.
- static void Clear() {
- delete value_;
- value_ = NULL;
- }
-
- // Returns true iff the user has set the default value for type T.
- static bool IsSet() { return value_ != NULL; }
-
- // Returns true if T has a default return value set by the user or there
- // exists a built-in default value.
- static bool Exists() {
- return IsSet() || internal::BuiltInDefaultValue::Exists();
- }
-
- // Returns the default value for type T if the user has set one;
- // otherwise returns the built-in default value if there is one;
- // otherwise aborts the process.
- static T Get() {
- return value_ == NULL ?
- internal::BuiltInDefaultValue::Get() : *value_;
- }
-
- private:
- static const T* value_;
-};
-
-// This partial specialization allows a user to set default values for
-// reference types.
-template
-class DefaultValue {
- public:
- // Sets the default value for type T&.
- static void Set(T& x) { // NOLINT
- address_ = &x;
- }
-
- // Unsets the default value for type T&.
- static void Clear() {
- address_ = NULL;
- }
-
- // Returns true iff the user has set the default value for type T&.
- static bool IsSet() { return address_ != NULL; }
-
- // Returns true if T has a default return value set by the user or there
- // exists a built-in default value.
- static bool Exists() {
- return IsSet() || internal::BuiltInDefaultValue::Exists();
- }
-
- // Returns the default value for type T& if the user has set one;
- // otherwise returns the built-in default value if there is one;
- // otherwise aborts the process.
- static T& Get() {
- return address_ == NULL ?
- internal::BuiltInDefaultValue::Get() : *address_;
- }
-
- private:
- static T* address_;
-};
-
-// This specialization allows DefaultValue::Get() to
-// compile.
-template <>
-class DefaultValue {
- public:
- static bool Exists() { return true; }
- static void Get() {}
-};
-
-// Points to the user-set default value for type T.
-template
-const T* DefaultValue